Skip to content

chore(deps)(deps-dev): bump @angular/compiler-cli in /frontend (#44) #19

chore(deps)(deps-dev): bump @angular/compiler-cli in /frontend (#44)

chore(deps)(deps-dev): bump @angular/compiler-cli in /frontend (#44) #19

name: Build and Push Frontend Image
on:
push:
branches: [main]
paths:
- 'frontend/**'
- '.github/workflows/build-frontend-image.yml'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/frontend
jobs:
build-schema:
name: Generate GraphQL Schema
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore PhantomDave.BankTracking.Api/PhantomDave.BankTracking.Api.csproj
- name: Start database
run: docker compose -f compose.dev.yaml up database -d --wait
- name: Start API in background
working-directory: ./PhantomDave.BankTracking.Api
run: |
dotnet run > api.log 2>&1 &
echo $! > api.pid
env:
ASPNETCORE_ENVIRONMENT: Development
- name: Wait for API to be ready
uses: jtalk/url-health-check-action@v4
with:
url: http://localhost:5095/graphql
max-attempts: 15
retry-delay: 2s
- name: Download GraphQL schema
run: curl -f http://localhost:5095/graphql?sdl -o frontend/schema.graphql
- name: Upload schema artifact
uses: actions/upload-artifact@v5
with:
name: graphql-schema
path: frontend/schema.graphql
retention-days: 1
build-and-push:
name: Build and Push Frontend Container
runs-on: ubuntu-latest
needs: build-schema
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Download schema artifact
uses: actions/download-artifact@v6
with:
name: graphql-schema
path: frontend
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix={{branch}}-
type=ref,event=branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push frontend image
uses: docker/build-push-action@v6
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}