-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add gha deploy.yml
- Loading branch information
Ron de las Alas
committed
Oct 3, 2023
1 parent
42ccab5
commit ae6e49b
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@scratchfoundation/scratch-engineering |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build and Deploy ScratchJr Website | ||
|
||
on: | ||
push: | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
environment: ${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node 17x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '17.x' | ||
- name: Install Dependencies | ||
run: npm install --legacy-peer-deps | ||
- name: Lint Site Code | ||
run: npm run test | ||
- name: Build Site | ||
run: npm run build | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }} | ||
role-session-name: GitHub-Action-Role | ||
aws-region: ${{ vars.AWS_REGION }} | ||
- name: Upload to S3 | ||
run: | | ||
aws s3 sync ./build s3://${{ vars.AWS_S3_BUCKET }}/junior/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,7 @@ npm-* | |
|
||
# Build | ||
/build | ||
|
||
# act | ||
.secrets | ||
.env |