-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.42 KB
/
registry.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Registry
# Put 'on' in quotes to avoid YAML parsing error
"on":
# Run on new releases
release:
types:
- published
jobs:
registry:
name: Publish Docker image to GitHub registry
# Pin version of Ubuntu to avoid breaking changes
runs-on: ubuntu-22.04
# Use reasonable timeout to avoid stuck workflows
timeout-minutes: 30
permissions:
# Needed to checkout code
contents: read
# Needed to push to registry
packages: write
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: ./
push: true
# Slashes are here to make the string multiline and avoid using spaces
tags: "\
ghcr.io/radio-aktywne/apps/jasmine\
:latest,\
ghcr.io/radio-aktywne/apps/jasmine\
:${{ github.event.release.tag_name }}"
# Cache Docker layers between builds
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}