also looking at this
fix(docs): deploy corrected active tabs
#81
6 files
+64
-5
| @@ -106,3 +106,54 @@ jobs: | ||
| 106 | 106 | run: pantry publish:commit './packages/*' |
| 107 | 107 | env: |
| 108 | 108 | PANTRY_REGISTRY_TOKEN: ${{ secrets.PANTRY_TOKEN }} |
| 109 | ||
| 110 | deploy-docs: | |
| 111 | name: deploy bunpress.org | |
| 112 | needs: [lint, typecheck, test] | |
| 113 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| 114 | runs-on: ubuntu-latest | |
| 115 | concurrency: | |
| 116 | group: bunpress-org-production | |
| 117 | cancel-in-progress: false | |
| 118 | env: | |
| 119 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| 120 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| 121 | AWS_DEFAULT_REGION: us-east-1 | |
| 122 | ||
| 123 | steps: | |
| 124 | - uses: actions/checkout@v6 | |
| 125 | ||
| 126 | - name: Setup Pantry | |
| 127 | uses: pantry-pm/pantry/packages/action@9f797da1ed073df7839cb6a9a7db6181ba33f0b7 | |
| 128 | with: | |
| 129 | version: 0.11.12 | |
| 130 | packages: bun.sh@1.3.14 | |
| 131 | install: 'false' | |
| 132 | ||
| 133 | - name: Install dependencies | |
| 134 | run: bun install --frozen-lockfile | |
| 135 | ||
| 136 | - name: Build documentation | |
| 137 | run: bun run build:docs | |
| 138 | ||
| 139 | - name: Publish site and invalidate CloudFront | |
| 140 | shell: bash | |
| 141 | run: | | |
| 142 | set -euo pipefail | |
| 143 | ||
| 144 | distribution_id="$( | |
| 145 | aws cloudfront list-distributions --output json \ | |
| 146 | | jq -r '[.DistributionList.Items[] | select((.Aliases.Items // []) | index("bunpress.org")) | .Id][0] // empty' | |
| 147 | )" | |
| 148 | ||
| 149 | if [[ -z "$distribution_id" ]]; then | |
| 150 | echo "Could not find the CloudFront distribution for bunpress.org." >&2 | |
| 151 | exit 1 | |
| 152 | fi | |
| 153 | ||
| 154 | aws s3 sync dist/.bunpress s3://bunpress-org \ | |
| 155 | --delete \ | |
| 156 | --cache-control 'max-age=3600, public' | |
| 157 | aws cloudfront create-invalidation \ | |
| 158 | --distribution-id "$distribution_id" \ | |
| 159 | --paths '/*' | |