Skip to content

πŸš€ Deploy frontend #2364

πŸš€ Deploy frontend

πŸš€ Deploy frontend #2364

name: πŸš€ Deploy frontend
on:
workflow_run:
workflows:
- 'Frontend CI'
branches:
- main
types: [completed]
workflow_dispatch:
jobs:
docker:
strategy:
matrix:
include:
- os: ubuntu-24.04
platform: amd64
- os: ubuntu-24.04-arm
platform: arm64
runs-on: ${{matrix.os}}
timeout-minutes: 80
permissions:
packages: write
concurrency:
group: ${{ matrix.platform }}-build_push_docker_frontend_prod
cancel-in-progress: true
steps:
# 2025-02-02: needs: 20 GB, post-cleanup-avail: 57G
- name: Free up space
run: |
sudo du -xh --max-depth=3 / 2>/dev/null | sort -rh | head -40 || true
sudo rm -rf /usr/share/swift /usr/lib/jvm /opt/* \
/usr/lib/dotnet /usr/share/az_* /usr/local/lib/android \
/usr/local/lib/android /usr/share/dotnet \
/usr/local/share/boost /usr/local/share/powershell \
/usr/lib/google-cloud-sdk /var/lib/apt/lists/*
sudo apt-get clean
df -h|grep "/dev/root"
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push production image
uses: docker/build-push-action@v6
with:
context: frontend
file: frontend/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
no-cache: true
platforms: linux/${{ matrix.platform }}
build-args: |
NEXT_PUBLIC_IS_PRODUCTION=true
ENABLE_SENTRY=true
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
GITHUB_SHA=${{ github.sha }}
tags: |
ghcr.io/flathub-infra/frontend:${{ github.sha }}
ghcr.io/flathub-infra/frontend:latest
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=ssh://[email protected]:${{ github.repository }}.git
org.opencontainers.image.url=https://github.com/${{ github.repository }}