cd: pantry.tgz #1987
This file contains hidden or 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: cd | |
run-name: "cd: pantry.tgz" | |
on: | |
push: | |
branches: main | |
paths: | |
- projects/**/* | |
- .github/workflows/cd.pantry.tgz.yml | |
# FIXME: https://github.com/pkgxdev/pkgx/issues/1021 | |
# run this nightly to ensure the tarball date is refreshed | |
schedule: | |
- cron: "0 0 * * *" | |
concurrency: | |
group: cd.pantry.tgz | |
cancel-in-progress: true | |
jobs: | |
tarball: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
x: | |
- flag: J | |
ext: tar.xz | |
- flag: z | |
ext: tgz | |
steps: | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- uses: actions/checkout@v4 | |
with: | |
path: co | |
- run: find co -type f -not -name package.yml -delete -o -type l -delete | |
- run: tar -C co -c${{ matrix.x.flag }}f pantry.${{ matrix.x.ext }} . | |
- run: aws s3 cp | |
./pantry.${{ matrix.x.ext }} | |
s3://${{ secrets.AWS_S3_BUCKET }}/pantry.${{ matrix.x.ext }} | |
- run: aws cloudfront create-invalidation | |
--distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} | |
--paths /pantry.${{ matrix.x.ext }} |