Skip to content

modify github actions #198

modify github actions

modify github actions #198

name: Build and Push to Docker Hub
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
push:
tags:
- '**'
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:

Check failure on line 15 in .github/workflows/docker-build-push.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker-build-push.yml

Invalid workflow file

You have an error in your yaml syntax on line 15
path_name: ["", "/sps-gui", "/proctoring-gui"],
tag_suffix: ["", "single-host", "single-host2"],
steps:
- name: Set env for dynamic tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}-${{ matrix.tag_suffix }}" >> $GITHUB_ENV
- name: Set env manual
if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=default_version-${{ matrix.tag_suffix }}" >> $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 }}
build-args:
VITE_SUB_PATH: ${{ matrix.path_name }}