Ligretto release #243
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: 'Ligretto release' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths: | |
- 'apps/ligretto-**' | |
- 'packages/ligretto-shared/**' | |
- 'packages/auth-front/**' | |
- 'packages/ui/**' | |
- .github/workflows/ligretto-deploy.yml | |
- '.docker/Ligretto-**' | |
- '.deploy/ligretto.deploy.yml' | |
- '.env*' | |
env: | |
LIGRETTO_APP_VERSION: ${{ github.run_id }} | |
jobs: | |
ligretto-frontend-build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- uses: ./.github/actions/prepare-nodejs | |
name: Prepare Node.js | |
- name: Build frontend | |
run: yarn run ligretto:front:build | |
env: | |
LIGRETTO_GAMEPLAY_URL: https://api.ligretto.app | |
LIGRETTO_CORE_URL: https://core.ligretto.app/api | |
CAS_PARTNER_ID: 652468293877db2de8390fa3 | |
CAS_STATIC_URL: https://cas.mems.fun/static | |
CAS_URL: https://cas.mems.fun/api | |
AMPLITUDE_TOKEN: f55f6d07422dfb26ca4dfbe59a54d609 | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
- name: Archive frontend production dist | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frontend-dist | |
path: | | |
apps/ligretto-frontend/dist | |
ligretto-gameplay-backend-image: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10485760 | |
- name: Docker login | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: | | |
ghcr.io/memebattle/ligretto-gameplay-backend:${{ github.sha }} | |
ghcr.io/memebattle/ligretto-gameplay-backend:${{ env.LIGRETTO_APP_VERSION }} | |
ghcr.io/memebattle/ligretto-gameplay-backend:latest | |
context: '.' | |
file: '.docker/Ligretto-gameplay-backend_Dockerfile' | |
cache-from: type=gha,scope=$GITHUB_REF_NAME-ligretto-gameplay-backend | |
cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-ligretto-gameplay-backend | |
ligretto-core-backend-image: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10485760 | |
- name: Docker login | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: | | |
ghcr.io/memebattle/ligretto-core-backend:${{ github.sha }} | |
ghcr.io/memebattle/ligretto-core-backend:${{ env.LIGRETTO_APP_VERSION }} | |
ghcr.io/memebattle/ligretto-core-backend:latest | |
context: '.' | |
file: '.docker/Ligretto-core-backend_Dockerfile' | |
cache-from: type=gha,scope=$GITHUB_REF_NAME-ligretto-core-backend | |
cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-ligretto-core-backend | |
deploy: | |
needs: [ligretto-gameplay-backend-image, ligretto-core-backend-image, ligretto-frontend-build] | |
runs-on: ubuntu-22.04 | |
environment: | |
name: Ligretto-production | |
url: https://ligretto.app | |
steps: | |
- uses: actions/checkout@main | |
name: Checkout | |
- name: Download frontend dist | |
id: download_frontend_dist | |
uses: actions/download-artifact@v3 | |
with: | |
name: frontend-dist | |
path: apps/ligretto-frontend/dist | |
- uses: ./.github/actions/deploy-to-swarm | |
name: Deploy to swarm lambda | |
with: | |
path-to-stack: '.deploy/ligretto.deploy.yml' | |
name: 'LIGRETTO' | |
yc_folder_id: ${{ vars.YC_FOLDER_ID }} | |
sa_auth_key: ${{ secrets.YC_WORKER_KEY }} | |
docker_registry_login: ${{ secrets.GHCR_USER }} | |
docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} | |
docker_registry: 'ghcr.io' | |
- uses: ./.github/actions/deploy-to-s3 | |
name: Deploy to s3 | |
with: | |
path-to-folder: apps/ligretto-frontend/dist | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
bucket: 'ligretto.app' | |