Skip to content

Merge pull request #44 from Accurate0/renovate/all-minor-patch #134

Merge pull request #44 from Accurate0/renovate/all-minor-patch

Merge pull request #44 from Accurate0/renovate/all-minor-patch #134

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-backend:
strategy:
fail-fast: false
matrix:
apps: [api, worker]
permissions:
packages: write
uses: Accurate0/workflows/.github/workflows/build-push-docker.yaml@main
with:
directory: .
image-name: perth-transport-map-${{ matrix.apps }}
docker-build-args: |
BINARY_NAME=perthtransport-${{ matrix.apps }}
use-rust-caching: true
build-web:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Docker build
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: perthtransport-web
push: true
tags: ghcr.io/accurate0/perth-transport-map-web:latest,ghcr.io/accurate0/perth-transport-map-web:${{ github.sha }}
build-args: |
VITE_MAPS_API_KEY=${{ secrets.VITE_MAPS_API_KEY }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
deploy:
needs:
- build-backend
- build-web
uses: Accurate0/workflows/.github/workflows/deploy-app-k8s.yaml@main
with:
application-name: perth-transport-map
secrets:
TS_OAUTH_CLIENT_ID: ${{ secrets.TS_OAUTH_CLIENT_ID }}
TS_OAUTH_SECRET: ${{ secrets.TS_OAUTH_SECRET }}
ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_AUTH_TOKEN }}