Create docker-image-push.yml

This commit is contained in:
Elias Projahn 2025-03-23 20:44:42 +01:00 committed by GitHub
parent bfde6c23f2
commit 66ebf66b4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

19
.github/workflows/docker-image-push.yml vendored Normal file
View file

@ -0,0 +1,19 @@
name: Push to Docker Hub
on:
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
continue-on-error: false
- name: Get release tag
run: echo "TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Build the Docker image
run: docker build . --file Dockerfile --tag johrpan/ubigen:$TAG --tag johrpan/ubigen:latest
- name: Push Docker image
run: docker push johrpan/ubigen:$TAG && docker push johrpan/ubigen:latest