I am trying to deploy static site to AWS S3 and Cloudfront with github action. My Github Action code is:
name: deploy-container
on:
push:
branches:
- master
paths:
- 'packages/container/**'
defaults:
run:
working-directory: packages/container
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run build
- uses: chrislennon/[email protected]
- run: aws s3 sync dist s3://${{secrets.AWS_S3_BUCKET_NAME}}/container/latest
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
But when I try to build I got these errors

GitHub will redeploy your application only if you did some change on a file inside of your application directory. I suppose that you have changed only your yml file and tried to rerun the job on GitHub. But from the error message, this is an unsecure method to use the tag ACTIONS_ALLOW_UNSECURE_COMMANDS. It is best to consider using the Official AWS for GitHub Actions instead of using the ACTIONS_ALLOW_UNSECURE_COMMANDS.
name: deploy-container
on:
push:
branches:
- master
paths:
- 'packages/container/**'
defaults:
run:
working-directory: packages/container
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets. AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets. AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Copy files to the s3 website content bucket
run:
aws s3 sync dist s3://${{ secrets.AWS_S3_BUCKET_NAME }}/container/latest
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run build
- uses: chrislennon/[email protected]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With