Small typos fix #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Containers to GitHub Container Registry | |
on: | |
push: | |
branches: ["main"] | |
tags: ["*"] | |
paths: | |
- 'api/**' | |
- 'controller/**' | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# https://github.com/docker/login-action | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata for api | |
id: meta-api | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-api | |
- name: Extract Docker metadata for controller | |
id: meta-controller | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-controller | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image for api | |
id: build-and-push-api | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./api | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta-api.outputs.tags }} | |
labels: ${{ steps.meta-api.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Build and push Docker image for controller | |
id: build-and-push-controller | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./controller | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta-controller.outputs.tags }} | |
labels: ${{ steps.meta-controller.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |