Skip to content

Commit d485e77

Browse files
committed
ci: update for release images
1 parent 5549e25 commit d485e77

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

.github/workflows/docker-pub.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
workflow_dispatch:
55
schedule:
66
- cron: "0 0 * * *"
7+
push:
8+
tags:
9+
- 'v*.*.*'
710

811
jobs:
912
build:
@@ -36,10 +39,15 @@ jobs:
3639
password: ${{ secrets.GH_TOKEN }}
3740

3841
- name: Build Meta
39-
run: echo "::set-output name=dtag::ghcr.io/barelyhuman/goblin:nightly-${{ steps.date.outputs.date }}"
40-
id: meta
42+
run: |
43+
echo "::set-output name=dtag::ghcr.io/barelyhuman/goblin:nightly-${{ steps.date.outputs.date }}"
4144
42-
- name: Build and push
45+
- name: Build Release Meta
46+
run: |
47+
echo "::set-output name=rtag::ghcr.io/barelyhuman/goblin:${{ github.ref_name }}"
48+
if: github.ref_type == 'tag'
49+
50+
- name: Build and push nightly
4351
uses: docker/build-push-action@v5
4452
id: push
4553
env:
@@ -52,7 +60,22 @@ jobs:
5260
platforms: linux/amd64,linux/arm64
5361
push: true
5462
tags: ${{ steps.meta.outputs.dtag }}
55-
63+
64+
- name: Build and push nightly
65+
if: github.ref_type == 'tag'
66+
uses: docker/build-push-action@v5
67+
id: push
68+
env:
69+
REGISTRY: ghcr.io
70+
OWNER: ${{ github.repository_owner }}
71+
IMAGE_NAME: ${{ github.repository }}
72+
with:
73+
context: .
74+
file: Dockerfile
75+
platforms: linux/amd64,linux/arm64
76+
push: true
77+
tags: ${{ steps.meta.outputs.rtag }}
78+
5679
- name: Generate artifact attestation
5780
uses: actions/attest-build-provenance@v1
5881
with:

0 commit comments

Comments
 (0)