Skip to content

Commit

Permalink
Update GitHub Actions workflow to configure AWS credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
andersy005 committed Nov 21, 2024
1 parent c3d5470 commit f1b08bc
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/update-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ on:
- cron: '45 6 * * *' # 6:45am UTC every day

env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
OFFSETS_DB_API_KEY_STAGING: ${{ secrets.OFFSETS_DB_API_KEY_STAGING }}
OFFSETS_DB_API_KEY_PRODUCTION: ${{ secrets.OFFSETS_DB_API_KEY_PRODUCTION }}
Expand All @@ -23,12 +21,27 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
seed-db:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::631969445205:role/github-action-role
role-session-name: samplerolesession
aws-region: ${{ env.AWS_DEFAULT_REGION }}

- name: Copy sample file to s3
run: |
aws s3 cp ./update_database.py s3://carbonplan-scratch/
- name: Get Current time in UTC in format YYYY-MM-DD HH:MM
if: always()
id: time
Expand Down

0 comments on commit f1b08bc

Please sign in to comment.