chore(ci): build and deploy web platform

This commit is contained in:
Jagandeep Brar
2022-03-23 22:45:01 -04:00
parent ba79ccaf2b
commit 7caca2e1a3
2 changed files with 128 additions and 0 deletions

View File

@@ -104,3 +104,15 @@ jobs:
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }}
web:
name: Web
needs: [ prepare, validate ]
if: ${{ needs.prepare.outputs.flavor == 'internal' }}
uses: JagandeepBrar/LunaSea/.github/workflows/release_web.yml@master
with:
flavor: ${{ needs.prepare.outputs.flavor }}
track: ${{ needs.prepare.outputs.track }}
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }}

116
.github/workflows/release_web.yml vendored Normal file
View File

@@ -0,0 +1,116 @@
name: '[Release] Web'
on:
workflow_call:
inputs:
flavor:
required: true
type: string
track:
required: true
type: string
secrets:
DISCORD_WEBHOOK:
required: true
FIREBASE_OPTIONS:
required: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download Source Files
uses: actions/download-artifact@v2
with:
name: lib-${{ github.sha }}
path: ${{ github.workspace }}/lib
- name: Download Localization Files
uses: actions/download-artifact@v2
with:
name: localization-${{ github.sha }}
path: ${{ github.workspace }}/assets/localization
- name: Install Secrets
working-directory: ${{ github.workspace }}
run: |
echo ${{ secrets.FIREBASE_OPTIONS }} | base64 --decode > lib/firebase_options.dart
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
cache-key: ${{ github.sha }}
- name: Setup Flutter
working-directory: ${{ github.workspace }}
run: |
flutter pub get
- name: Build LunaSea
working-directory: ${{ github.workspace }}
run: |
flutter build web --web-renderer canvaskit --release
- name: Upload Web Build Artifact
uses: actions/upload-artifact@v2
with:
name: web-${{ inputs.flavor }}-${{ github.sha }}
path: ${{ github.workspace }}/build/web
- name: Send Discord Message
uses: sarisia/actions-status-discord@v1
if: always()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
title: '`[${{ inputs.track }}]` Web Build'
description: web-${{ inputs.flavor }}-${{ github.sha }}
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [ build ]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Download Web Build Artifact
uses: actions/download-artifact@v2
with:
name: web-${{ inputs.flavor }}-${{ github.sha }}
path: ${{ github.workspace }}
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
branch: web-deployment
folder: ${{ github.workspace}}/build/web
git-config-name: ${{ github.sha }}
clean: true
clean-exclude: |
CNAME
- name: Tag Deployment
uses: richardsimko/update-tag@v1
with:
tag_name: 'web-${{ inputs.flavor }}'
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Send Discord Message
uses: sarisia/actions-status-discord@v1
if: always()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
title: '`[${{ inputs.track }}]` Web Deployment'
description: web-${{ inputs.flavor }}-${{ github.sha }}