This repository has been archived by the owner on Jan 9, 2025. It is now read-only.
Merge pull request #25 from tsdataclinic/nathancy-api-key-provider #42
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: Staging CI/CD Pipeline | |
on: | |
push: | |
branches: [ develop ] | |
jobs: | |
continuous-integration: | |
# This job compiles all necessary bundles (e.g. frontend and server) to | |
# make sure everything builds successfully. This is also where we would | |
# want to run tests before we move to the `continuous-deployment` job. | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build frontend | |
run: yarn build | |
continuous-deployment: | |
# This job deploys the entire repo if CI job succeeded. | |
runs-on: ubuntu-latest | |
needs: [ continuous-integration ] | |
if: github.ref == 'refs/heads/develop' | |
steps: | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
# using empty role-to-assume, because we are using IAM User's Access | |
# and Secret Key | |
aws-region: ${{ secrets.AWS_REGION }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Create CodeDeploy Deployment | |
id: deploy | |
run: | | |
aws deploy create-deployment \ | |
--application-name EmpowerK12 \ | |
--deployment-group-name ek12_staging_deployment_group \ | |
--deployment-config-name CodeDeployDefault.OneAtATime \ | |
--github-location repository=${{ github.repository }},commitId=${{ github.sha }} |