Skip to content

Use docker compose to build the container #3

Use docker compose to build the container

Use docker compose to build the container #3

name: Build and Push Docker Image

Check failure on line 1 in .github/workflows/build-docker-image.yml

View workflow run for this annotation

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

Invalid workflow file

(Line: 28, Col: 19): Unrecognized function: 'toLower'. Located at position 1 within expression: toLower(github.repository)
on:
push:
branches:
- main
paths:
- 'build/dockerfile'
- 'build/requirements.txt'
- 'build/docker-compose.yml'
- '.github/workflows/build-docker-image.yml'
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ toLower(github.repository) }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push via Docker compose
uses: docker/bake-action@v5
with:
files: build/docker-compose.yml
targets: app
set: |
*.tags=${{ steps.meta.outputs.tags }}
*.labels=${{ steps.meta.outputs.labels }}
push: true