Skip to content

Commit ae914d8

Browse files
authored
updated action
1 parent 2840f12 commit ae914d8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/dockerhub-image.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker Image CI
1+
name: DockerHub Image CI
22

33
on:
44
push:
@@ -8,10 +8,6 @@ on:
88
release:
99
types: [published]
1010

11-
permissions:
12-
packages: write
13-
contents: read
14-
1511
jobs:
1612
build-main:
1713
runs-on: ubuntu-latest
@@ -28,11 +24,20 @@ jobs:
2824
username: ${{ secrets.DOCKERHUB_USERNAME }}
2925
password: ${{ secrets.DOCKERHUB_TOKEN }}
3026

27+
- name: Extract metadata (tags, labels)
28+
id: meta
29+
run: |
30+
if [[ "${{ github.event_name }}" == "push" ]]; then
31+
echo "TAG_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
32+
elif [[ "${{ github.event_name }}" == "release" ]]; then
33+
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
34+
fi
35+
3136
- name: Build and Push Docker Image
3237
uses: docker/[email protected]
3338
with:
3439
platforms: linux/amd64,linux/arm64
3540
push: true
36-
tags: makeplane/iframely:latest
41+
tags: makeplane/iframely:${{ env.TAG_NAME }}
3742
env:
3843
DOCKER_BUILDKIT: 1

0 commit comments

Comments
 (0)