Skip to content

Sync CloudFormation templates #10

Sync CloudFormation templates

Sync CloudFormation templates #10

Workflow file for this run

name: Sync CloudFormation templates
on:
workflow_dispatch:
inputs:
source_dir:
description: 'Directory to sync with AWS S3'
required: true
default: 'aws/eks'
dest_dir:
description: 'AWS S3 bucket folder to sync with'
required: true
default: 'eks'
exclude_pattern:
description: 'Pattern to exclude from sync process'
required: true
default: '*.html'
jobs:
sync_templates:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v4
with:
audience: sts.amazonaws.com
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_GA_ROLE }}
- name: Sync bucket
env:
SOURCE_DIR: ${{ github.event.inputs.source_dir }}
DEST_DIR: ${{ github.event.inputs.dest_dir }}
EXCLUDE_PATTERN: ${{ github.event.inputs.exclude_pattern }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_REGION: ${{ secrets.AWS_REGION }}
run: |
aws s3 sync ${SOURCE_DIR} s3://${AWS_S3_BUCKET}/${DEST_DIR} --exclude ${EXCLUDE_PATTERN} --no-progress