Skip to content

Fixed tags for !is_default_branch for workflow #2

Fixed tags for !is_default_branch for workflow

Fixed tags for !is_default_branch for workflow #2

Workflow file for this run

name: Build
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
# branches: [ "master" ]
branches: [ "github-action" ] # for debug
pull_request:
branches: [ "master" ]
env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build-image-visualization:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/visualization
tags: |

Check failure on line 45 in .github/workflows/build-publish.yml

View workflow run for this annotation

GitHub Actions / Build

Invalid workflow file

The workflow is not valid. .github/workflows/build-publish.yml (Line: 45, Col: 17): The expression is not closed. An unescaped ${{ sequence was found, but the closing }} sequence was not found.
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value={{branch}},enable=${{ github.ref != format('refs/heads/{0}', 'master')
- name: Build and push Docker image (visualization)
uses: docker/build-push-action@v5
with:
context: ./visualization
#file: ./visualization/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}