Website deployment #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Website deployment | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: bin/install_dependencies.sh | |
- name: Run the PDF compilation process | |
run: bin/build.sh | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.CI_CD_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.CI_CD_AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_DEFAULT_REGION }} | |
- name: Trigger S3 deployment | |
run: | | |
aws s3 sync build s3://wca-documents/ --acl public-read | |
# Update version file so the website will update its cache | |
git_hash=$(git rev-parse --short "$GITHUB_SHA") | |
echo "$git_hash" > version | |
aws s3 cp version s3://wca-documents/version | |
aws cloudfront create-invalidation --distribution-id E31ELE3W069ZX7 --paths "/*" --output text |