feat: updating template #1
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
on: | |
push: | |
branches: | |
- main | |
concurrency: push_main | |
name: 🚀 Deploy staging | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
env: | |
AWS_REGION: eu-west-2 | |
STAGE: staging | |
jobs: | |
build-format-lint-test: | |
name: 🚀 Build, lint and test | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Install & cache node dependencies | |
uses: ./.github/actions/install-node-deps | |
- name: Lint | |
run: pnpm lint | |
- name: Test Unit | |
run: pnpm test-unit | |
deploy-staging: | |
name: Deploy staging | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: build-format-lint-test | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Install & cache node dependencies | |
uses: ./.github/actions/install-node-deps | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN_STAGING }} | |
role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Deploy | |
working-directory: apps/backend/ | |
run: pnpm run deploy --require-approval never | |
integration-tests: | |
name: Run integration tests | |
needs: deploy-staging | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Install & cache node dependencies | |
uses: ./.github/actions/install-node-deps | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN_STAGING }} | |
role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Run integration tests | |
run: pnpm test-integration |