Created
May 8, 2022 08:08
-
-
Save schosterbarak/14abb9b464a90098593954285f569aec to your computer and use it in GitHub Desktop.
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 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