Skip to content

Build and Release Web version web #41

Build and Release Web version web

Build and Release Web version web #41

run-name: "Build and Release Web version ${{ github.ref_name }}"
on:
push:
branches:
- web
workflow_dispatch:
env:
IMAGE_PREFIX: ghcr.io/dk10ws/slcm
jobs:
build-backend:
name: Build FastAPI application docker image
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
ref: "web"
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push backend Docker Image
uses: docker/build-push-action@v6
with:
context: backend
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ env.IMAGE_PREFIX }}-backend:latest
${{ env.IMAGE_PREFIX }}-backend:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-frontend:
name: Build Flutter Web application docker image
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
ref: "web"
- name: Cache pub deps
uses: actions/cache@v5
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: ${{ runner.os }}-pub-
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Build web app
working-directory: frontend
run: |
flutter pub get
flutter build web
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push frontend Docker Image
uses: docker/build-push-action@v6
with:
context: frontend
file: frontend/Dockerfile.actions
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ env.IMAGE_PREFIX }}-frontend:latest
${{ env.IMAGE_PREFIX }}-frontend:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max