Enables the use of the aws
command line in your Github action. See Managing access keys for IAM users on generating an access key/secret key pair.
Using an IAM role is preferred, although a key ID and secret access key are supported
- uses: nrccua/github-action-install-awscli
with:
# AWS Access Key
# Required: False
aws_key_id: ''
# AWS Secret Access Key
# Required: False
aws_secret_access_key: ''
# AWS IAM Role ARN
# Required: False
aws_iam_role: ''
# The AWS Region to use
# Default: us-east-1
# Required: False
aws_region: ''
name: Deploy To S3
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- run: my_build.sh
- name: Install AWS CLI
uses: nrccua/github-action-install-awscli@master
with:
#aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
#aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY_ID }}
aws_iam_role: ${{ secrets.AWS_IAM_ROLE }}
aws_region: ${{ secrets.AWS_REGION }}
- name: Copy files to S3
shell: bash
env:
aws_s3_bucket: ${{ secrets.AWS_S3_BUCKET }}
run: |
# Copy up build to s3
aws s3 cp --acl public-read --recursive ./my_build_directoy s3://$aws_s3_bucket/