diff --git a/.github/workflows/copy-to-s3.yaml b/.github/workflows/copy-to-s3.yaml new file mode 100644 index 0000000..da66781 --- /dev/null +++ b/.github/workflows/copy-to-s3.yaml @@ -0,0 +1,29 @@ +--- +name: Copy to S3 +on: + push: + branches: + - master +env: + AWS_DEFAULT_REGION: us-west-2 + AWS_DEFAULT_OUTPUT: json +jobs: + copy-to-s3: + runs-on: ubuntu-latest + # These permissions are needed to interact with GitHub’s OIDC Token endpoint. + permissions: + id-token: write + contents: read + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-region: us-west-2 + ## the following creates an ARN based on the values entered into github secrets + role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_GITHUB_ACTIONS_ROLE }} + - name: Copy files to S3 + run: | + aws s3 sync . s3://aws-bootcamp-us-east-1 --exclude "*" --include "resources/*" --include "source/*" --acl authenticated-read --delete +... \ No newline at end of file