Skip to content

PushToProd

PushToProd #51

Workflow file for this run

name: PushToProd
permissions:
id-token: write
on:
workflow_dispatch:
inputs:
website:
description: 'Name of the S3 bucket aka website to publish to'
required: true
default: 'amazon-dynamodb-labs.com'
options:
- 'test.amazon-dynamodb-labs.com'
- 'amazon-dynamodb-labs.com'
jobs:
buildAndDeploy:
runs-on: ubuntu-latest
env:
STEP_S3_BUCKET: ${{ github.event.inputs.website }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.102.3'
# extended: true
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Build Hugo
run: hugo --buildFuture
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
- name: Build Assets
run: python3 ./.github/scripts/build-assets.py
- name: S3Sync
run: aws s3 sync public s3://$STEP_S3_BUCKET --delete
- name: SetS3Acl
run: aws s3api put-object-acl --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers --bucket $STEP_S3_BUCKET --key assets/lab.yaml
- name: SetS3AclED1
run: aws s3api put-object-acl --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers --bucket $STEP_S3_BUCKET --key assets/GeneratorLambdaPackage.zip
- name: SetS3AclED2
run: aws s3api put-object-acl --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers --bucket $STEP_S3_BUCKET --key assets/MapLambdaPackage.zip
- name: SetS3AclED3
run: aws s3api put-object-acl --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers --bucket $STEP_S3_BUCKET --key assets/ReduceLambdaPackage.zip
- name: SetS3AclED4
run: aws s3api put-object-acl --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers --bucket $STEP_S3_BUCKET --key assets/StateLambdaPackage.zip
- name: SetS3AclED5
run: aws s3api put-object-acl --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers --bucket $STEP_S3_BUCKET --key assets/event-driven-cfn.yaml
- name: SetS3AclLHOLEnv
run: aws s3api put-object-acl --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers --bucket $STEP_S3_BUCKET --key assets/migration-env-setup.yaml
- name: SetS3AclLHOLDMS
run: aws s3api put-object-acl --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers --bucket $STEP_S3_BUCKET --key assets/migration-dms-setup.yaml