Skip to content

Commit 029bc58

Browse files
committed
separating latest and dev github actions
1 parent e50cbec commit 029bc58

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

.github/workflows/docker-image.yml .github/workflows/dev-docker-image.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
name: Docker Image CI
1+
name: dev:Docker Image CI
22

33
on:
44
release:
5-
types: [published, prereleased]
5+
types: [prereleased]
6+
push:
7+
branches:
8+
- next
69

710
jobs:
811
build:
@@ -31,8 +34,6 @@ jobs:
3134
with:
3235
platforms: linux/arm64,linux/amd64
3336
push: true
34-
tags: |
35-
rsstranslator/rsstranslator:${{ steps.latesttag.outputs.tag }}
36-
${{ github.event.release.prerelease && 'rsstranslator/rsstranslator:dev' || 'rsstranslator/rsstranslator:latest' }}
37+
tags: rsstranslator/rsstranslator:dev,rsstranslator/rsstranslator:${{ steps.latesttag.outputs.tag }}
3738

3839

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: latest:Docker Image CI
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0 # Fetch all history for all tags and branches
18+
19+
- name: Get latest tag
20+
id: latesttag
21+
run: echo ::set-output name=tag::$(git describe --tags `git rev-list --tags --max-count=1`)
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Login to Docker Hub
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
- name: Build and push multi-platform Docker images
33+
uses: docker/build-push-action@v5
34+
with:
35+
platforms: linux/arm64,linux/amd64
36+
push: true
37+
tags: rsstranslator/rsstranslator:latest,rsstranslator/rsstranslator:${{ steps.latesttag.outputs.tag }}
38+
39+

0 commit comments

Comments
 (0)