Skip to content

fix: handle repeating on anilist #352

fix: handle repeating on anilist

fix: handle repeating on anilist #352

Workflow file for this run

name: Deployment
on:
push:
tags:
- '2.*'
branches:
- beta
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: 'actions/checkout@v4'
- name: Docker meta frontend
id: meta-frontend
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_FRONTEND }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=raw,value=release,enable=${{ startsWith(github.ref, 'refs/tags/2.') }}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/2.') }}
- name: Docker meta backend
id: meta-backend
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_BACKEND }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=raw,value=release,enable=${{ startsWith(github.ref, 'refs/tags/2.') }}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/2.') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Deploy Backend
uses: docker/build-push-action@v6
with:
context: '{{defaultContext}}:backend'
push: true
tags: ${{ steps.meta-backend.outputs.tags }}
- name: Deploy Frontend
uses: docker/build-push-action@v6
with:
context: '{{defaultContext}}:frontend'
push: true
tags: ${{ steps.meta-frontend.outputs.tags }}
build-args: |
BUILD_ENV=${{ fromJSON(steps.meta-frontend.outputs.json).labels['org.opencontainers.image.version'] == 'beta' && 'beta' || 'production' }}
deploy-beta:
if: github.ref == 'refs/heads/beta'
needs: build
runs-on: ubuntu-latest
steps:
- uses: 'google-github-actions/auth@v2'
with:
service_account: ${{ secrets.GCP_SA_NAME }}
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Deploy Frontend to Google Cloud Run
uses: google-github-actions/deploy-cloudrun@v2
with:
service: myanili-frontend-beta
image: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_FRONTEND }}:beta
region: europe-west1
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Deploy Backend to Google Cloud Run
uses: google-github-actions/deploy-cloudrun@v2
with:
service: myanili-backend-release
image: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_BACKEND }}:beta
region: europe-west1
project_id: ${{ secrets.GCP_PROJECT_ID }}
deploy-production:
if: startsWith(github.ref, 'refs/tags/2.')
needs: build
runs-on: ubuntu-latest
steps:
- uses: 'google-github-actions/auth@v2'
with:
service_account: ${{ secrets.GCP_SA_NAME }}
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Deploy to Google Cloud Run
uses: google-github-actions/deploy-cloudrun@v2
with:
service: myanili
image: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_FRONTEND }}
region: europe-west1
project_id: ${{ secrets.GCP_PROJECT_ID }}