Skip to content

Instantly share code, notes, and snippets.

@schosterbarak
Created May 8, 2022 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schosterbarak/14abb9b464a90098593954285f569aec to your computer and use it in GitHub Desktop.
Save schosterbarak/14abb9b464a90098593954285f569aec to your computer and use it in GitHub Desktop.
name: AWS example workflow
on:
push
env:
BUCKET_NAME : "<example-bucket-name>"
AWS_REGION : "<example-aws-region>"
# permission can be added at job level or workflow level
permissions:
id-token: write
contents: read # This is required for actions/checkout
jobs:
S3PackageUpload:
runs-on: MY-PRIVATE-RUNNER
steps:
- name: Git clone the repository
uses: actions/checkout@v3
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::1234567890:role/GITHUB-UPLOAD-WEBSITE-ROLE
role-session-name: samplerolesession
aws-region: ${{ env.AWS_REGION }}
# Upload a file to AWS s3
- name: Copy index.html to s3
run: |
aws s3 cp ./index.html s3://${{ env.BUCKET_NAME }}/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment