Adjusted Dockerfile #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Save tag to file if release | |
if: startsWith(github.ref, 'refs/tags/') | |
run: echo ${{ github.ref_name }} > VERSION.txt | |
- name: Build the Docker image for temporary use only | |
if: ${{ ! startsWith(github.ref, 'refs/tags/') }} | |
run: docker build . --file Dockerfile --tag tmp:latest | |
- name: Build the Docker image for tag release | |
if: startsWith(github.ref, 'refs/tags/') | |
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKER_IMAGE_NAME }}:latest | |
- name: Docker Login | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Tag latest docker image | |
if: startsWith(github.ref, 'refs/tags/') | |
run: docker tag ${{ secrets.DOCKER_IMAGE_NAME }}:latest wseresearch/${{ secrets.DOCKER_IMAGE_NAME }}:latest | |
- name: Tag docker image version | |
if: startsWith(github.ref, 'refs/tags/') | |
run: docker tag ${{ secrets.DOCKER_IMAGE_NAME }}:latest "wseresearch/${{ secrets.DOCKER_IMAGE_NAME }}:${{ github.ref_name }}" | |
- name: Push latest docker image | |
if: startsWith(github.ref, 'refs/tags/') | |
run: docker push wseresearch/${{ secrets.DOCKER_IMAGE_NAME }}:latest | |
- name: Push docker image version | |
if: startsWith(github.ref, 'refs/tags/') | |
run: docker push "wseresearch/${{ secrets.DOCKER_IMAGE_NAME }}:${{ github.ref_name }}" | |
- name: Init update | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: WSE-research/[email protected] | |
with: | |
updater_host: ${{ secrets.UPDATER_HOST }} | |
api_key: ${{ secrets.API_KEY }} |