Skip to content

build on merge

build on merge #3

# A github action that builds a container image for the project.
name: Build Container
on:
pull_request:
branches: [main]
paths:
# This is the entire list of files that will trigger the workflow.
- Dockerfile
- pyproject.toml
- requirements-gpu.txt
- .github/workflows/build-container.yaml
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
# This is the name of the image that will be pushed to Docker Hub. If the branch is main, the image will be tagged as latest. Else, it will be tagged as the branch name.
tags: ${{ secrets.DOCKERHUB_USERNAME }}/taxpose:${{ github.ref == 'refs/heads/main' && 'latest' || replace(github.ref, 'refs/heads/', '') }}

Check failure on line 34 in .github/workflows/build-container.yaml

View workflow run for this annotation

GitHub Actions / Build Container

Invalid workflow file

The workflow is not valid. .github/workflows/build-container.yaml (Line: 34, Col: 17): Unrecognized function: 'replace'. Located at position 48 within expression: github.ref == 'refs/heads/main' && 'latest' || replace(github.ref, 'refs/heads/', '')