diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 7fa8af3d..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,69 +0,0 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/configuration-reference -version: 2.1 - -orbs: - slack: circleci/slack@4.12.5 - aws-s3: circleci/aws-s3@3.1.1 -executors: - scratchjr-website-executor: - docker: - - image: cimg/node:17.0.0 - resource_class: small - -aliases: - - &deploy - steps: - - slack/notify: - channel: C033BNUG2F7 - event: fail - template: SLACK_SCRATCH_JR_SITE_FAIL - - slack/notify: - channel: C033BNUG2F7 - event: pass - template: SLACK_SCRATCH_JR_SITE_SUCCESS -jobs: - setup_and_deploy: - executor: scratchjr-website-executor - steps: - - checkout - - run: - name: Install Dependencies - command: npm install - - run: - name: Lint Site Code - command: npm run test - - run: - name: Build Site - command: npm run build - - when: - condition: - or: - - equal: [ develop, << pipeline.git.branch >> ] - steps: - - aws-s3/sync: - role-arn: '${AWS_OIDC_IAM_ROLE}' - role-session-name: "develop-branch-session" - aws-region: AWS_REGION - from: ./build - to: '${S3_BUCKET_NAME_DEV}' - <<: *deploy - - when: - condition: - or: - - equal: [ master, << pipeline.git.branch >> ] - steps: - - aws-s3/sync: - role-arn: '${AWS_OIDC_IAM_ROLE}' - role-session-name: "master-branch-session" - aws-region: AWS_REGION - from: ./build - to: '${S3_BUCKET_NAME_PRODUCTION}' - <<: *deploy -workflows: - build_and_deploy_scratchjr-website: - jobs: - - setup_and_deploy: - name: Setup and Deploy ScratchJR Website - context: - - slack-notifications 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..e13d1fca --- /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 ci --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