Skip to content

Commit 2bedc14

Browse files
author
Sri Ramanujam
committed
Workflow to publish to ghcr on release
1 parent cef627b commit 2bedc14

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
publish-to-ghcr:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
-
14+
name: Checkout
15+
uses: actions/checkout@v2
16+
-
17+
name: Set up QEMU
18+
uses: docker/setup-qemu-action@v1
19+
-
20+
name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v1
22+
-
23+
name: Login to GitHub Container Registry
24+
uses: docker/login-action@v1
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.repository_owner }}
28+
password: ${{ secrets.CR_PAT }}
29+
-
30+
name: Set tag name in environment
31+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
32+
-
33+
name: Build and push
34+
uses: docker/build-push-action@v2
35+
with:
36+
context: .
37+
platforms: linux/amd64,linux/arm64
38+
push: true
39+
tags: |
40+
ghcr.io/${{ github.repository }}:latest
41+
ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}

0 commit comments

Comments
 (0)