Fixes images

This commit is contained in:
Gabriel Matte 2024-10-03 23:51:44 -04:00
parent 1f78c44be2
commit 3fea24630a

View file

@ -1,5 +1,4 @@
name: create-branch-images name: create-branch-images
on: on:
workflow_call: workflow_call:
workflow_dispatch: workflow_dispatch:
@ -10,46 +9,29 @@ on:
- '**' - '**'
jobs: jobs:
docker: build-frontend:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Frontend Docker
- name: Extract metadata (tags, labels) for Docker
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: | images: ghcr.io/${{ github.repository }}-frontend
ghcr.io/${{ github.repository }}/frontend
ghcr.io/${{ github.repository }}/backend
ghcr.io/${{ github.repository }}/router
tags: | tags: |
type=schedule
type=ref,event=branch type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}} type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}} - name: Build and push Frontend Docker image
type=semver,pattern={{major}} uses: docker/build-push-action@v5
- name: Build and push frontend Docker image
uses: docker/build-push-action@v3
with: with:
context: ./client context: ./client
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
@ -59,8 +41,29 @@ jobs:
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
- name: Build and push backend Docker image build-backend:
uses: docker/build-push-action@v3 runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Backend Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}-backend
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Build and push Backend Docker image
uses: docker/build-push-action@v5
with: with:
context: ./server context: ./server
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
@ -70,8 +73,29 @@ jobs:
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
- name: Build and push router Docker image build-router:
uses: docker/build-push-action@v3 runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Router Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}-router
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Build and push Router Docker image
uses: docker/build-push-action@v5
with: with:
context: ./nginx context: ./nginx
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}