diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 70e45428..04deed9e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,13 +16,11 @@ jobs: run: bin/install_dependencies.sh - name: Run the PDF compilation process - run: bin/build.sh - - - name: Push to GitHub build branch - uses: JamesIves/github-pages-deploy-action@4.1.4 - with: - branch: build - folder: build + run: | + wget https://github.com/jgm/pandoc/releases/download/2.2.2.1/pandoc-2.2.2.1-1-amd64.deb -O /tmp/pandoc.deb + sudo dpkg -i /tmp/pandoc.deb + wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -O /tmp/wkhtml.tar.xz + sudo tar -xf /tmp/wkhtml.tar.xz --strip-components=1 -C /usr/local - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 @@ -31,9 +29,11 @@ jobs: aws-secret-access-key: ${{ secrets.CI_CD_AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - name: Trigger website deployment - env: - DOCUMENTS_BUCKET: wca-documents - DISTRIBUTION_ID: E31ELE3W069ZX7 + - name: Trigger S3 deployment run: | - bin/deploy.sh + 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 diff --git a/bin/deploy.sh b/bin/deploy.sh deleted file mode 100755 index a347e1d8..00000000 --- a/bin/deploy.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -aws s3 sync build s3://$DOCUMENTS_BUCKET/ --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://$DOCUMENTS_BUCKET/version -aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*" --output text