2023-01-19 00:13:20 +03:00
|
|
|
|
name: cd
|
|
|
|
|
|
2022-03-25 16:52:12 +03:00
|
|
|
|
on:
|
|
|
|
|
push:
|
2022-04-25 22:06:30 +03:00
|
|
|
|
branches:
|
|
|
|
|
- main
|
2022-04-25 19:41:24 +03:00
|
|
|
|
paths-ignore:
|
2022-07-07 23:18:49 +03:00
|
|
|
|
- '*.md'
|
2022-03-14 17:54:16 +03:00
|
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
|
group: deploy
|
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
deploy:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- name: Create Deployment
|
2022-05-04 22:08:51 +03:00
|
|
|
|
uses: bobheadxi/deployments@v1
|
2022-03-14 17:54:16 +03:00
|
|
|
|
id: deployment
|
|
|
|
|
with:
|
|
|
|
|
step: start
|
|
|
|
|
env: aws
|
|
|
|
|
|
2022-05-04 22:08:51 +03:00
|
|
|
|
- uses: actions/checkout@v3
|
2022-03-14 17:54:16 +03:00
|
|
|
|
|
2022-10-14 16:51:00 +03:00
|
|
|
|
- name: Copy packages.json summary from dist.tea.xyz
|
|
|
|
|
uses: prewk/s3-cp-action@v2
|
|
|
|
|
with:
|
|
|
|
|
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
|
|
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
2022-11-03 14:59:11 +03:00
|
|
|
|
source: 's3://dist.tea.xyz/mock_packages.json'
|
2022-10-14 16:51:00 +03:00
|
|
|
|
dest: './src/data/packages.json'
|
2022-10-13 10:29:27 +03:00
|
|
|
|
|
2022-10-14 04:46:45 +03:00
|
|
|
|
- name: Create Package Detail Pages from packages.json
|
2022-10-14 05:46:41 +03:00
|
|
|
|
uses: getneil/jq-action@v1
|
2022-10-14 04:46:45 +03:00
|
|
|
|
id: version
|
|
|
|
|
with:
|
2022-11-14 14:55:33 +03:00
|
|
|
|
cmd: '.github/build-package-pages.sh src/data/packages.json src/content'
|
2022-10-14 05:46:41 +03:00
|
|
|
|
|
2022-07-07 23:18:49 +03:00
|
|
|
|
- uses: teaxyz/setup@v0
|
2023-01-19 00:13:20 +03:00
|
|
|
|
- run: tea -E just ci
|
|
|
|
|
|
2022-12-31 03:48:09 +03:00
|
|
|
|
# NOTE: temp disabled? maybe can be addressed by https://github.com/teaxyz/www/issues/252
|
|
|
|
|
# - name: Check for broken links
|
|
|
|
|
# uses: lycheeverse/lychee-action@v1
|
|
|
|
|
# with:
|
|
|
|
|
# fail: true
|
|
|
|
|
# args: --verbose --no-progress './public/**/*.md' './public/**/*.html'
|
|
|
|
|
# env:
|
|
|
|
|
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
2022-08-22 23:12:58 +03:00
|
|
|
|
|
2022-03-14 17:54:16 +03:00
|
|
|
|
## means s3 sync will only sync things we need sync’d
|
2022-11-03 14:53:38 +03:00
|
|
|
|
# - uses: chetan/git-restore-mtime-action@v1
|
2022-03-14 17:54:16 +03:00
|
|
|
|
|
|
|
|
|
- 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
|
2022-11-29 04:45:36 +03:00
|
|
|
|
|
2022-03-14 17:54:16 +03:00
|
|
|
|
# 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: |
|
2022-11-03 14:52:06 +03:00
|
|
|
|
aws s3 sync public s3://www.tea.xyz \
|
2022-03-14 17:54:16 +03:00
|
|
|
|
--metadata-directive REPLACE \
|
|
|
|
|
--cache-control max-age=600 \
|
|
|
|
|
--exclude '.git/*' --exclude '.github/*' \
|
2022-11-19 08:00:03 +03:00
|
|
|
|
--exclude 'Images/packages/*' \
|
2022-05-04 04:06:13 +03:00
|
|
|
|
--exclude 'pour.sh' \
|
2022-10-07 17:38:04 +03:00
|
|
|
|
--exclude 'tea.white-paper*.pdf' \
|
2022-03-25 16:39:06 +03:00
|
|
|
|
--exclude '*.md' \
|
2022-12-02 04:25:34 +03:00
|
|
|
|
--exclude 'tea-*+*' \
|
2022-03-14 17:54:16 +03:00
|
|
|
|
--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.
|
2022-11-03 14:52:06 +03:00
|
|
|
|
- run: |
|
|
|
|
|
aws cloudfront create-invalidation \
|
|
|
|
|
--distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} \
|
|
|
|
|
--paths '/*'
|
2022-03-14 17:54:16 +03:00
|
|
|
|
|
|
|
|
|
- name: Seal Deployment
|
2022-05-04 22:08:51 +03:00
|
|
|
|
uses: bobheadxi/deployments@v1
|
2022-03-14 17:54:16 +03:00
|
|
|
|
if: always()
|
|
|
|
|
with:
|
|
|
|
|
step: finish
|
|
|
|
|
status: ${{ job.status }}
|
|
|
|
|
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
|
2022-05-04 22:08:51 +03:00
|
|
|
|
env: ${{ steps.deployment.outputs.env }}
|