👷 will this even work ? #30
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: Build and Push Thullo Images | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: | |
- develop | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build-push-frontend: | |
name: Build and Push Thullo Frontend | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
attestations: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache turbo artefacts | |
uses: actions/cache@v3 | |
with: | |
path: '**/.turbo' | |
key: ${{ runner.OS }}-turbo-cache-${{ hashFiles('pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.OS }}-turbo-cache- | |
- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2 | |
with: | |
version: 8.15.9 | |
- name: Use Node.js version 20.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
- name: Build front with node | |
run: | | |
FORCE_COLOR=true pnpm install --frozen-lockfile | |
FORCE_COLOR=true pnpm turbo build --filter @thullo/front | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the Container registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.CONTAINER_REGISTRY_PAT }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: Dockerfile.front | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ghcr.io/fredkiss3/thullo-front:latest,ghcr.io/fredkiss3/thullo-front:${{ github.sha }} | |
cache-from: type=registry,ref=ghcr.io/fredkiss3/thullo-front:latest | |
cache-to: type=inline | |
build-push-backend: | |
name: Build and Push Thullo API | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
attestations: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache turbo artefacts | |
uses: actions/cache@v3 | |
with: | |
path: '**/.turbo' | |
key: ${{ runner.OS }}-turbo-cache-${{ hashFiles('pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.OS }}-turbo-cache- | |
- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2 | |
with: | |
version: 8.15.9 | |
- name: Use Node.js version 20.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
- name: Build API with node | |
run: | | |
FORCE_COLOR=true pnpm install --frozen-lockfile | |
FORCE_COLOR=true pnpm turbo build --filter @thullo/api | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the Container registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.CONTAINER_REGISTRY_PAT }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: Dockerfile.api | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ghcr.io/fredkiss3/thullo-api:latest,ghcr.io/fredkiss3/thullo-api:${{ github.sha }} | |
cache-from: | | |
type=registry,ref=ghcr.io/fredkiss3/thullo-api:latest | |
cache-to: type=inline |