changes #167
Workflow file for this run
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: Build and Push to Docker Hub | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [ "main" ] | |
push: | |
tags: | |
- '**' | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set env for dynamic tag | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set env manual | |
if: github.event_name == 'workflow_dispatch' | |
run: echo "TAG_NAME=default_version" >> $GITHUB_ENV | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Login to DockerHub | |
uses: docker/[email protected] | |
with: | |
username: naritter | |
password: ${{ secrets.DOCKERHUB_PASSWORD}} | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: docker.io/naritter/seb-sps-gui:${{ env.TAG_NAME }} |