publish gh-pages #2209
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: publish gh-pages | ||
| on: | ||
| workflow_dispatch: | ||
| workflow_call: | ||
| env: | ||
| GH_BOT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com" | ||
| GH_BOT_NAME: "GitHub Action" | ||
| DENO_DIR: .deno-cache | ||
| REPO: commonhaus/commonhaus.github.io | ||
| permissions: {} | ||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: true | ||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: github-pages | ||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
| # Cancel in-progress runs if a new one is queued | ||
| steps: | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
| ref: 'main' | ||
| - name: Cache node modules | ||
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 | ||
| with: | ||
| path: node_modules | ||
| key: ${{ hashFiles('deno.lock') }} | ||
| - name: Cache Deno dependencies | ||
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 | ||
| with: | ||
| path: ${{ env.DENO_DIR }} | ||
| key: ${{ hashFiles('deno.lock') }} | ||
| - name: Setup Deno environment | ||
| uses: denoland/setup-deno@e95548e56dfa95d4e1a28d6f422fafe75c4c26fb # v2.0.3 | ||
| with: | ||
| deno-version: v2.x | ||
| - name: Build info | ||
| run: deno info | ||
| - name: Build site | ||
| run: deno task build | ||
| - name: Setup Pages | ||
| if: github.ref == 'refs/heads/main' && github.repository == ${{ env.REPO }} | ||
|
Check warning on line 61 in .github/workflows/gh-pages.yml
|
||
| id: pages | ||
| uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | ||
| - name: Upload artifact | ||
| if: github.ref == 'refs/heads/main' && github.repository == ${{ env.REPO }} | ||
|
Check warning on line 66 in .github/workflows/gh-pages.yml
|
||
| uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 | ||
| with: | ||
| path: ./public | ||
| - name: Deploy to GitHub Pages | ||
| if: github.ref == 'refs/heads/main' && github.repository == ${{ env.REPO }} | ||
|
Check warning on line 72 in .github/workflows/gh-pages.yml
|
||
| id: deployment | ||
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| needs: publish | ||
| if: always() | ||
| steps: | ||
| - if: ${{ needs.publish.result != 'failure' }} | ||
| run: | | ||
| echo "Deployment successful" | ||
| - if: ${{ needs.publish.result == 'failure' }} | ||
| run: | | ||
| echo "Deployment failed" | ||
| exit 1 | ||