Fix bytes/bits mixup #36
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: Deploy docs to S3 | |
on: | |
push: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: s3 | |
cancel-in-progress: false | |
jobs: | |
build: | |
uses: ./.github/workflows/build.yml | |
check: | |
uses: ./.github/workflows/pre-commit.yml | |
deploy: | |
environment: | |
name: s3 | |
url: https://static.zeek.org/spicy-course/index.html | |
runs-on: ubuntu-latest | |
needs: | |
- check | |
- build | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.STATIC_ZEEK_ORG_AWS_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.STATIC_ZEEK_ORG_AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Upload | |
run: | | |
# Upload the generate docs and delete removed files. | |
aws s3 sync spicy-course s3://static.zeek.org/spicy-course --delete | |
# Add a top-level object `spicy-course/` which could be reached from | |
# `https://static.zeek.org/spicy-course`, i.e., without having to | |
# explicitly name `index.html`. | |
# | |
# TODO(bbannier): This is currently broken for unclear reasons. | |
aws s3 cp spicy-course/index.html s3://static.zeek.org/spicy-course/ | |
# Invalidate cloudfront so the changes become reachable immediately. | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.STATIC_ZEEK_ORG_CLOUDFRONT_DISTRIBUTION }} --paths "/spicy-course/*" |