Skip to content

πŸš€ Deploy frontend #842

πŸš€ Deploy frontend

πŸš€ Deploy frontend #842

name: πŸš€ Deploy frontend
on:
workflow_run:
workflows:
- 'Frontend CI'
branches:
- main
types: [completed]
workflow_dispatch:
jobs:
beta:
runs-on: ubuntu-latest
concurrency:
group: build_push_docker_frontend_beta
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push beta image
uses: docker/build-push-action@v4
with:
context: frontend
file: frontend/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/flathub/frontend:${{ github.sha }}
ghcr.io/flathub/frontend:beta
ghcr.io/flathub/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 }}
cache-from: type=gha
cache-to: type=gha,mode=max
prod:
runs-on: ubuntu-latest
concurrency:
group: build_push_docker_frontend_prod
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push production image
uses: docker/build-push-action@v4
with:
context: frontend
file: frontend/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
no-cache: true
build-args: |
NEXT_PUBLIC_IS_PRODUCTION=true
ENABLE_SENTRY=true
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
tags: |
ghcr.io/flathub/frontend:${{ github.sha }}-prod
ghcr.io/flathub/frontend:prod
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 }}