[MIK-373] Create cutscenes #910
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: alpha.miku.gg deployment | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- apps/interactor/** | |
- packages/** | |
- .github/workflows/alpha.miku.gg.yml | |
- package.json | |
- pnpm-lock.yaml | |
- pnpm-workspace.yaml | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- master | |
paths: | |
- apps/interactor/** | |
- packages/** | |
- .github/workflows/alpha.miku.gg.yml | |
- package.json | |
- pnpm-lock.yaml | |
- pnpm-workspace.yaml | |
jobs: | |
build_and_test_job: | |
if: github.event_name != 'push' || github.ref != 'refs/heads/master' | |
runs-on: ubuntu-latest | |
name: Build and Test Job | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Install | |
run: npm i -g pnpm && pnpm install --no-frozen-lockfile && pnpm test && pnpm run build --scope=@mikugg/interactor | |
deploy_job: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
name: Deploy Job | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Setup AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-west-2 | |
- name: Install | |
run: npm i -g pnpm && pnpm install --no-frozen-lockfile && pnpm run build --scope=@mikugg/interactor | |
env: | |
VITE_SERVICES_ENDPOINT: ${{ secrets.VITE_SERVICES_ENDPOINT }} | |
VITE_CARD_ENDPOINT: ${{ secrets.VITE_BOT_DIRECTORY_ENDPOINT }} | |
VITE_ASSETS_ENDPOINT: ${{ secrets.VITE_ASSETS_DIRECTORY_ENDPOINT }} | |
VITE_ASSETS_UPLOAD_URL: ${{ secrets.VITE_ASSETS_UPLOAD_URL }} | |
VITE_BACKGROUND_SEARCH_ENDPOINT: ${{ secrets.VITE_BACKGROUND_SEARCH_ENDPOINT }} | |
VITE_CHARACTER_SEARCH_ENDPOINT: ${{ secrets.VITE_CHARACTER_SEARCH_ENDPOINT }} | |
VITE_GTM_ID: ${{ secrets.VITE_GTM_ID}} | |
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN}} | |
- name: Deploy to S3 | |
run: aws s3 sync apps/interactor/dist ${{ secrets.S3_BUCKET_ALPHA }} --delete | |
- name: Set Cache-Control | |
run: aws s3 cp apps/interactor/dist/index.html ${{ secrets.S3_BUCKET_ALPHA }}/index.html --metadata-directive REPLACE --cache-control max-age=0 | |
- name: Invalidate Cloudfront distribution | |
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ALPHA }} --paths "/*" |