Skip to content

Commit bea7e5d

Browse files
Fix Github Actions
1 parent abb41db commit bea7e5d

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

.github/workflows/deploy.yml

+19-5
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,33 @@ jobs:
2525
username: ${{ secrets.PRIVATE_REGISTRY_USER }}
2626
password: ${{ secrets.PRIVATE_REGISTRY_PW }}
2727

28+
- name: Extract Docker metadata
29+
id: meta-docker
30+
uses: docker/metadata-action@v4
31+
with:
32+
images: ${{ secrets.PRIVATE_REGISTRY_URL }}/heppa
33+
tags: |
34+
type=schedule
35+
type=ref,event=branch
36+
type=ref,event=tag
37+
type=sha
38+
${{ github.event_name == 'release' && format('type=raw,value={0}', github.event.release.tag_name) }}
39+
2840
- name: Build and push Docker image
29-
run: |
30-
export TAG=$(echo $GITHUB_SHA | cut -c1-7)
31-
docker build -t ${{ secrets.PRIVATE_REGISTRY_URL }}/heppa:$TAG .
32-
docker push ${{ secrets.PRIVATE_REGISTRY_URL }}/heppa:$TAG
41+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
42+
with:
43+
context: .
44+
push: ${{ github.event_name == 'release' }}
45+
tags: ${{ steps.meta-docker.outputs.tags }}
46+
labels: ${{ steps.meta-docker.outputs.labels }}
3347

3448
release:
3549
name: Deploy a new release
3650
runs-on: ubuntu-latest
3751

3852
if: ${{ github.event_name == 'release' }}
3953

40-
needs: [build]
54+
needs: [ build ]
4155

4256
steps:
4357
- name: Trigger deployment

0 commit comments

Comments
 (0)