chore: update workflow for docker build and publish

This commit is contained in:
Marius Begby committed 2023-08-20 20:33:18 +02:00
1 parent c2a79688a5
commit c361a4148d
2 files changed
+27

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
name: Build and Push Docker Image on Release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract release tag name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Build and Push Docker Image
run: |
docker build -t mariusbegby/cadence:${{ env.RELEASE_VERSION }} .
docker push mariusbegby/cadence:${{ env.RELEASE_VERSION }}