Skip to content

Commit 3fcd2c2

Browse files
committed
Update github workflows
1 parent 691f375 commit 3fcd2c2

File tree

3 files changed

+82
-7
lines changed

3 files changed

+82
-7
lines changed

.github/release-drafter.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
categories:
6+
- title: '🚀 Features'
7+
labels:
8+
- 'feature'
9+
- title: '🐛 Bug Fixes'
10+
labels:
11+
- 'bug'
12+
- title: 📝 Documentation updates
13+
labels:
14+
- documentation
15+
- title: 👻 Maintenance
16+
labels:
17+
- dependencies
18+
- title: 🚦 Tests
19+
labels:
20+
- tests
21+
- title: Other Changes
22+
labels:
23+
- "*"

.github/workflows/release-ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Inject slug/short variables
20+
uses: rlespinasse/github-slug-action@v4
21+
22+
- name: Set up Docker Buildx
23+
id: buildx
24+
uses: docker/setup-buildx-action@v3
25+
with:
26+
driver: docker-container
27+
28+
- name: Available platforms
29+
run: echo ${{ steps.buildx.outputs.platforms }}
30+
31+
- name: Login to Docker Hub
32+
uses: docker/login-action@v3
33+
with:
34+
username: ${{ secrets.DOCKERHUB_USER }}
35+
password: ${{ secrets.DOCKERHUB_TOKEN }}
36+
37+
- name: Set env variables
38+
id: set_env
39+
run: |
40+
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
41+
42+
- name: Build and push
43+
uses: docker/build-push-action@v6
44+
with:
45+
context: .
46+
file: ./Dockerfile-nginx
47+
platforms: linux/amd64,linux/arm64
48+
push: true
49+
build-args: |
50+
VERSION=${{ env.TAG_NAME }}
51+
tags: |
52+
cairry/watchalert-web:latest
53+
cairry/watchalert-web:${{ env.TAG_NAME }}

.github/workflows/ci.yaml renamed to .github/workflows/test-ci.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
6+
- '*/*'
77

88
jobs:
99
build:
@@ -22,6 +22,8 @@ jobs:
2222
- name: Set up Docker Buildx
2323
id: buildx
2424
uses: docker/setup-buildx-action@v3
25+
with:
26+
driver: docker-container
2527

2628
- name: Available platforms
2729
run: echo ${{ steps.buildx.outputs.platforms }}
@@ -36,18 +38,15 @@ jobs:
3638
id: set_env
3739
run: |
3840
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
39-
echo "SHORT_SHA=${GITHUB_SHA:0:4}" >> $GITHUB_ENV
40-
echo "DATE=$(TZ=Asia/Shanghai date +%Y-%m-%d.%H-%M-%S)" >> $GITHUB_ENV
4141
4242
- name: Build and push
4343
uses: docker/build-push-action@v6
4444
with:
4545
context: .
4646
file: ./Dockerfile-nginx
47-
platforms: linux/arm64,linux/amd64
48-
push: ${{ github.event_name != 'pull_request' }}
47+
platforms: linux/amd64,linux/arm64
48+
push: true
4949
build-args: |
5050
VERSION=${{ env.DATE }}
5151
tags: |
52-
cairry/watchalert-web:latest
53-
cairry/watchalert-web:${{ env.BRANCH_NAME }}.${{ env.DATE }}.${{ env.SHORT_SHA }}
52+
cairry/watchalert-web:${{ env.BRANCH_NAME }}

0 commit comments

Comments
 (0)