Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release to Production | |
on: | |
push: | |
tags: | |
- "v*" | |
permissions: | |
id-token: write | |
contents: write | |
packages: write | |
jobs: | |
build-frontend-docker: | |
uses: ./.github/workflows/frontend-docker.yml | |
with: | |
tag: ${{ github.ref_name }} | |
secrets: inherit | |
build-backend-docker: | |
uses: ./.github/workflows/backend-docker.yml | |
with: | |
tag: ${{ github.ref_name }} | |
secrets: inherit | |
build-frontend: | |
needs: [build-frontend-docker] | |
uses: ./.github/workflows/frontend.yml | |
with: | |
tag: ${{ github.ref_name }} | |
secrets: inherit | |
release-github: | |
needs: [build-backend-docker, build-frontend] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref_name }} | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: frontend-build | |
path: dist/frontend/ | |
- name: Create Frontend Build Archive | |
run: cd dist/ && tar -czf frontend-build.tar frontend/ | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: dist/frontend-build.tar | |
tag_name: ${{ github.ref_name }} | |
body_path: CHANGELOG.md | |
release-docker: | |
needs: [release-github] | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create Frontend Docker Release | |
uses: ./.github/actions/docker-release | |
with: | |
release_tag: ${{ github.ref_name }} | |
image_name: ${{ vars.FRONTEND_IMAGE_NAME }} | |
old_tag: main-dev | |
registry: ${{ vars.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Backend Docker Release | |
uses: ./.github/actions/docker-release | |
with: | |
release_tag: ${{ github.ref_name }} | |
image_name: ${{ vars.BACKEND_IMAGE_NAME }} | |
old_tag: main | |
registry: ${{ vars.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
release-cloudflare: | |
needs: [build-frontend, release-github] | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
url: ${{ steps.deploy.outputs.deployment-url }} | |
steps: | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: frontend-build | |
path: dist/frontend/ | |
- name: Upload Build Artifacts | |
uses: cloudflare/wrangler-action@v3 | |
id: deploy | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy dist/frontend/ --project-name=tmvisdb | |
release-sentry: | |
needs: [release-github] | |
environment: production | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Sentry release | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
with: | |
environment: production |