Skip to content

publish gh-pages

publish gh-pages #2057

Workflow file for this run

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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
submodules: recursive
ref: 'main'
- name: Cache node modules
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: node_modules
key: ${{ hashFiles('deno.lock') }}
- name: Cache Deno dependencies
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
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 }}
id: pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- name: Upload artifact
if: github.ref == 'refs/heads/main' && github.repository == ${{ env.REPO }}
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 }}
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