www/.github/workflows/cd.yml
Thomas Smith b3d7689011
Hugo
* Initial Hugo buildout

* Initial Hugo buildout

* Progress

* Initial Hugo buildout

* Initial Hugo buildout

* Progress

* Rebase on main

* sync to #41

* Additional fixes; partials image paths, white-paper page.

* White-paper separate nav, 404 cleanup.

* banner update

* Initial Hugo buildout

* Initial Hugo buildout

* Progress

* Initial Hugo buildout

* Initial Hugo buildout

* Progress

* Rebase on main

* sync to #41

* Additional fixes; partials image paths, white-paper page.

* White-paper separate nav, 404 cleanup.

* banners from `main`

* white-paper CTA styling, auth # fix, title fix

* Better invalidation path

* Footer nav fix

* White paper, not white-paper. QR Code page

* Superfluous XML Files

* README.md additions

* Style changes

Co-authored-by: Jacob Heider <jacob@tea.xyz>
2022-06-07 19:18:10 -04:00

73 lines
2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
concurrency:
group: deploy
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Create Deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{ github.token }}
env: aws
- uses: actions/checkout@v3
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
- name: Build
run: hugo --minify
## means s3 sync will only sync things we need syncd
- uses: chetan/git-restore-mtime-action@v1
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
# cache-control of 10 mins because we *need* to be able to update
# this and have people see the results can be fixed well with a static site builder
- run: |
aws s3 sync public s3://www.tea.xyz \
--metadata-directive REPLACE \
--cache-control max-age=600 \
--exclude '.git/*' --exclude '.github/*' \
--exclude 'pour.sh' \
--exclude 'tea.white-paper.pdf' \
--exclude '*.md' \
--delete
#TODO create a github-action that can be used to parse the
# output from `s3 sync` into invalidation commands. NOTE
# I have already looked for something to do this and failed.
- run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} \
--paths '/*'
- name: Seal Deployment
uses: bobheadxi/deployments@v1
if: always()
with:
step: finish
token: ${{ github.token }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env: ${{ steps.deployment.outputs.env }}