From ae6e49b876e836ecf82c86b4e0bd9ad59bb3819f Mon Sep 17 00:00:00 2001 From: Ron de las Alas Date: Thu, 28 Sep 2023 16:13:18 -0400 Subject: [PATCH] ci: update codeowners file add gha deploy.yml --- .github/CODEOWNERS.md | 1 + .github/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++++ .gitignore | 4 ++++ 3 files changed, 37 insertions(+) create mode 100644 .github/CODEOWNERS.md create mode 100644 .github/workflows/deploy.yml diff --git a/.github/CODEOWNERS.md b/.github/CODEOWNERS.md new file mode 100644 index 00000000..a905f98f --- /dev/null +++ b/.github/CODEOWNERS.md @@ -0,0 +1 @@ +@scratchfoundation/scratch-engineering diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..526fa073 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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/ diff --git a/.gitignore b/.gitignore index 13e3656e..50cda1ab 100755 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ npm-* # Build /build + +# act +.secrets +.env