-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (57 loc) · 1.66 KB
/
publish-docker.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: publish docker image
on:
release:
types: [published]
push:
branches:
- dev
jobs:
publish:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up dev (edge) image metadata
id: meta-dev
uses: docker/metadata-action@v5
if: ${{ github.event_name != 'release' }}
with:
images: ghcr.io/idoneam/Canary
flavor: |
latest=false
tags: |
type=raw,value=dev,enable={{is_default_branch}}
type=sha,prefix=sha-
- name: Set up release image metadata
id: meta-release
uses: docker/metadata-action@v5
if: ${{ github.event_name == 'release' }}
with:
images: ghcr.io/idoneam/Canary
flavor: |
latest=true
tags: |
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push dev (edge) image
uses: docker/build-push-action@v6
if: ${{ github.event_name != 'release' }}
with:
context: .
push: true
tags: ${{ steps.meta-dev.outputs.tags }}
- uses: docker/build-push-action@v6
if: ${{ github.event_name == 'release' }}
with:
context: .
push: true
tags: ${{ steps.meta-release.outputs.tags }}