Skip to content

Commit d7d94b9

Browse files
authored
M #-: Add "Release" GA workflow (#9)
1 parent b2e410e commit d7d94b9

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Release
3+
4+
on:
5+
push:
6+
tags: ["v*.*.*"]
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Login to GHCR
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: "${{ github.actor }}"
24+
password: "${{ secrets.GITHUB_TOKEN }}"
25+
26+
- name: Build image
27+
run: docker build . --tag "ghcr.io/${GITHUB_REPOSITORY,,}:$GITHUB_REF_NAME"
28+
29+
- name: Push image
30+
run: docker push "ghcr.io/${GITHUB_REPOSITORY,,}:$GITHUB_REF_NAME"
31+
32+
- name: Tag image (latest)
33+
run: docker tag "ghcr.io/${GITHUB_REPOSITORY,,}:$GITHUB_REF_NAME" "ghcr.io/${GITHUB_REPOSITORY,,}:latest"
34+
35+
- name: Push image (latest)
36+
run: docker push "ghcr.io/${GITHUB_REPOSITORY,,}:latest"
37+
38+
- name: Create release
39+
env: { GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" }
40+
run: gh release create "$GITHUB_REF_NAME" --generate-notes

0 commit comments

Comments
 (0)