Skip to content

Commit 9aa8e3c

Browse files
authored
Merge pull request #54 from Gsync/dev
Fix release workflow
2 parents 0144e6d + 3ebd4e2 commit 9aa8e3c

2 files changed

Lines changed: 49 additions & 57 deletions

File tree

.github/workflows/docker-release.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/release-please.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
name: release-please
1+
name: Release
22

33
on:
44
push:
55
branches:
66
- main
77

8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
812
permissions:
913
contents: write
1014
pull-requests: write
15+
packages: write
1116

1217
jobs:
1318
release-please:
@@ -21,3 +26,46 @@ jobs:
2126
with:
2227
release-type: node
2328
target-branch: main
29+
30+
build-and-push:
31+
needs: release-please
32+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@v3
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Log in to GHCR
45+
uses: docker/login-action@v3
46+
with:
47+
registry: ${{ env.REGISTRY }}
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Extract metadata (tags, labels)
52+
id: meta
53+
uses: docker/metadata-action@v5
54+
with:
55+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
56+
tags: |
57+
type=semver,pattern={{version}},value=${{ needs.release-please.outputs.tag_name }}
58+
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release-please.outputs.tag_name }}
59+
type=semver,pattern={{major}},value=${{ needs.release-please.outputs.tag_name }}
60+
type=raw,value=latest
61+
62+
- name: Build and push
63+
uses: docker/build-push-action@v6
64+
with:
65+
context: .
66+
platforms: linux/amd64,linux/arm64
67+
push: true
68+
tags: ${{ steps.meta.outputs.tags }}
69+
labels: ${{ steps.meta.outputs.labels }}
70+
cache-from: type=gha
71+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)