Skip to content

Commit 688d09f

Browse files
authored
Update ci-and-push.yml
1 parent fafaa2a commit 688d09f

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

.github/workflows/ci-and-push.yml

+19-6
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,29 @@ jobs:
6060
runs-on: ubuntu-latest
6161
steps:
6262
- name: Check out the repo
63-
uses: actions/checkout@main
63+
uses: actions/checkout@v4
64+
with:
65+
fetch-depth: '0'
66+
- name: 'Get Previous tag'
67+
id: previoustag
68+
uses: "WyriHaximus/github-action-get-previous-tag@v1"
69+
with:
70+
fallback: 1.0.0 # Optional fallback tag to use when no tag can be found
6471
- name: Set up Docker metadata
6572
id: meta
6673
uses: docker/metadata-action@v3
6774
with:
68-
images: ukwa/heritrix
75+
images: ukwa/heritrix
76+
# generate Docker tags based on the following events/attributes
77+
tags: |
78+
type=raw,value=${{ steps.previoustag.outputs.tag }}
79+
type=schedule
80+
type=ref,event=branch
81+
type=ref,event=pr
82+
type=semver,pattern={{version}}
83+
type=semver,pattern={{major}}.{{minor}}
84+
type=semver,pattern={{major}}
85+
type=sha
6986
- name: Log in to Docker Hub
7087
if: github.event_name != 'pull_request'
7188
uses: docker/login-action@v1
@@ -78,7 +95,3 @@ jobs:
7895
push: ${{ github.event_name != 'pull_request' }}
7996
tags: ${{ steps.meta.outputs.tags }}
8097
labels: ${{ steps.meta.outputs.labels }}
81-
build-args: |
82-
GIT_VERSION_TAG=${{ env.RELEASE_VERSION }}
83-
GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }}
84-
GIT_VERSION_HASH=${{ github.sha }}

0 commit comments

Comments
 (0)