Skip to content

Commit

Permalink
feat(workflow): Manual workflow for frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNuttall committed Dec 1, 2024
1 parent 8a4dfbe commit c80c8cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 80 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/deploy-backend.yml

This file was deleted.

23 changes: 14 additions & 9 deletions .github/workflows/deploy-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
name: Build + Deploy Frontend

on:
push:
branches:
- main
paths:
- 'frontend/game/**'
workflow_dispatch:
inputs:
buildPath:
description: 'Frontend App'
required: true
default: 'game'
type: choice
options:
- game
- xmas

jobs:
build-frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend/game
working-directory: './frontend/$BUILD_PATH'

permissions:
id-token: write
Expand All @@ -27,7 +32,7 @@ jobs:
with:
node-version: '20'
cache: 'yarn'
cache-dependency-path: 'frontend/game/yarn.lock'
cache-dependency-path: 'frontend/${{ inputs.buildPath }}/yarn.lock'

- name: Install Dependancies
run: yarn install
Expand All @@ -47,5 +52,5 @@ jobs:

- name: Deploy static site to S3 bucket
run: |
aws s3 sync ./dist/ ${{ secrets.AWS_BUCKET_PATH }} --delete
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/projects/game/index.html"
aws s3 sync ./dist/ "${{ secrets.AWS_BUCKET_PATH_GAME }}/${{ inputs.buildPath }}" --delete
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/projects/${{ inputs.buildPath }}/index.html"

0 comments on commit c80c8cc

Please sign in to comment.