Merge pull request #381 from dfpc-coe/name-change #70
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: AWS ECR | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
strategy: | |
matrix: | |
task: [api, data, pmtiles, hooks, events] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{github.event.pull_request.head.sha || github.sha}} | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws-us-gov:iam::${{secrets.AWS_ACCOUNT_ID}}:role/Github-ECR-Builder | |
role-session-name: GithubECRBuilder | |
aws-region: ${{secrets.AWS_REGION}} | |
- name: Docker Build Task | |
run: npm run build -- ${{matrix.task}} | |
env: | |
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID}} | |
AWS_REGION: ${{secrets.AWS_REGION}} | |
- name: Configure AWS Credentials (STAGING) | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{secrets.AWS_STAGING_ACCOUNT_ID}}:role/Github-ECR-Builder | |
role-session-name: GithubECRBuilder | |
aws-region: ${{secrets.AWS_STAGING_REGION}} | |
- name: Docker Build Task (STAGING) | |
run: npm run build -- ${{matrix.task}} | |
env: | |
AWS_ACCOUNT_ID: ${{secrets.AWS_STAGING_ACCOUNT_ID}} | |
AWS_REGION: ${{secrets.AWS_STAGING_REGION}} | |