Skip to content

Build API

Build API #14

name: Build API
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- 'main'
paths:
- 'api/**'
- '.github/workflows/call-docker-build-api.yaml'
pull_request:
branches:
- 'main'
paths:
- 'api/**'
- '.github/workflows/call-docker-build-api.yaml'
schedule:
# re-run montly to keep image fresh with upstream base images
- cron: '0 12 15 * *'
workflow_dispatch:
# cancel any previously-started, yet still active runs of this workflow on the same branch
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
call-docker-build:
name: Call Docker Build
uses: bretfisher/docker-build-workflow/.github/workflows/reusable-docker-build.yaml@main
permissions:
contents: read
packages: write # needed to push docker image to ghcr.io
pull-requests: write # needed to create and update comments in PRs
secrets:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
with:
dockerhub-enable: true
ghcr-enable: true
image-names: |
bretfisher/wordsmith-api
ghcr.io/bretfisher/wordsmith-api
context: "{{defaultContext}}:api"
platforms: linux/amd64,linux/arm64