Skip to content

Commit 6bb0bfa

Browse files
committed
update docker build action
1 parent 29a3740 commit 6bb0bfa

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/docker-latest.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,44 @@ on:
88
required: true
99
default: '1.2.2'
1010

11-
push: { tags: 'v[0-9]+.[0-9]+.[0-9]+' }
11+
push:
12+
tags:
13+
- 'v[0-9]+.[0-9]+.[0-9]+'
1214

1315
jobs:
1416
docker:
1517
runs-on: ubuntu-latest
18+
1619
steps:
1720
- name: Checkout
1821
uses: actions/checkout@v4
22+
1923
- name: Extract tag
20-
run: echo "TAG=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
24+
if: github.event_name == 'push'
25+
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
26+
27+
- name: Set tag from input
28+
if: github.event_name == 'workflow_dispatch'
29+
run: echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
30+
2131
- name: Set up QEMU
2232
uses: docker/setup-qemu-action@v3
33+
2334
- name: Set up Docker Buildx
2435
uses: docker/setup-buildx-action@v3
36+
2537
- name: Login to Docker Hub
2638
uses: docker/login-action@v3
2739
with:
2840
username: ${{ secrets.DOCKERHUB_USERNAME }}
2941
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
3043
- name: Build and push
3144
uses: docker/build-push-action@v5
3245
with:
3346
context: .
3447
platforms: linux/amd64,linux/arm64
3548
push: true
36-
tags: dannyben/bashly,dannyben/bashly:${{ env.TAG }}
49+
tags: |
50+
dannyben/bashly
51+
dannyben/bashly:${{ env.TAG }}

0 commit comments

Comments
 (0)