Skip to content

Commit 6b2cb31

Browse files
committed
add release workflow
1 parent bf26104 commit 6b2cb31

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release Workflow
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
web:
9+
name: Push website Docker image to registry
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
contents: read
14+
steps:
15+
- name: Check out the repo
16+
uses: actions/checkout@v3
17+
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v2
20+
21+
- name: Set up Docker Buildx
22+
id: buildx
23+
uses: docker/setup-buildx-action@v2
24+
with:
25+
buildkitd-flags: --debug
26+
27+
- name: Log in to the Container registry
28+
uses: docker/login-action@v2
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Extract metadata (tags, labels) for Docker
35+
id: meta
36+
uses: docker/metadata-action@v4
37+
with:
38+
images: |
39+
ghcr.io/huskydog9988/docker-db-backup
40+
tags: |
41+
type=schedule,pattern=nightly
42+
type=semver,pattern=v{{version}}
43+
type=semver,pattern=v{{major}}.{{minor}}
44+
type=semver,pattern=v{{major}}
45+
type=ref,event=branch
46+
type=ref,event=pr
47+
type=sha
48+
# set latest tag for stable releases
49+
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
50+
51+
- name: Build and push image
52+
id: build-and-push
53+
uses: docker/build-push-action@v4
54+
with:
55+
context: .
56+
push: true
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}
59+
platforms: linux/amd64,linux/arm64
60+
cache-from: type=gha
61+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)