Skip to content

Create docker image for routes #5

Create docker image for routes

Create docker image for routes #5

Workflow file for this run

name: Build Docker Images for GHCR
on:
push:
branches:
- main
jobs:
build-image:
name: Build Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- Dockerfile: coffee-maker/Dockerfile
context: coffee-maker
tag: latest
name: "coffee-maker"
- Dockerfile: routes/Dockerfile
context: routes
tag: latest
name: "routes"
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- name: Checkout code
uses: actions/checkout@v4
- name: set repository name to lowercase
run: |
echo "reponame=${reponame,,}" >>${GITHUB_ENV}
env:
reponame: '${{ github.repository }}'
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }} # Use the new secret here
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/une-tasse-de.cafe/${{ env.reponame }}/${{ matrix.name }}:${{ matrix.tag }}
platforms: linux/amd64,linux/arm64