Skip to content

Remove TypeScript links from "Board for Each" and "Object Manipulator… #246

Remove TypeScript links from "Board for Each" and "Object Manipulator…

Remove TypeScript links from "Board for Each" and "Object Manipulator… #246

Workflow file for this run

name: Build, Test and Deploy
on:
push:
workflow_dispatch:
pull_request:
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm ci
name: Install dependencies
- name: Build
run: npx -y quartz build --bundleInfo
- uses: actions/upload-artifact@v4
with:
path: public
name: public
test:
runs-on: ubuntu-latest
outputs:
passed: ${{ steps.test.outputs.passed }}
failed: ${{ steps.test.outputs.failed }}
skipped: ${{ steps.test.outputs.skipped }}
permissions:
contents: read
issues: write
statuses: write
checks: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache .url-cache
uses: actions/cache@v4
env:
cache-name: cache-url-cache
with:
path: ./.url-cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('.url-cache') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm ci
- run: npm run check-urls
id: test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# preview:
# name: Preview when PR exists branch
# runs-on: ubuntu-latest
# needs: build
# if: github.event_name == 'pull_request' && github.event.action != 'closed'
# permissions:
# id-token: write
# pages: write
# steps:
# - name: Check out the repo
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Get artifacts from build job
# uses: actions/download-artifact@v4
# with:
# name: public
# path: public
# - uses: actions/upload-pages-artifact@v3
# with:
# path: public
# name: pages
# - name: Deploy to GitHub Pages
# uses: actions/deploy-pages@v4
# with:
# artifact_name: pages
# preview: true
deploy:
concurrency:
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}-deploy
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs:
- build
- test
runs-on: ubuntu-latest
permissions:
id-token: write
pages: write
contents: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get git commit hash
id: get_commit_hash
run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Get the ISO timestamp of the latest commit
id: get_timestamp
run: echo "COMMIT_TIMESTAMP=$(git log -1 --pretty=format:'%cI')" >> $GITHUB_ENV
- name: Make tag name from timestamp
id: make_tag_name
run: echo "TIMESTAMP_TAG=$(date -d $COMMIT_TIMESTAMP +%Y/%m/%d/%H%M%S)" >> $GITHUB_ENV
- name: Create and push tag on given commit
run: |
git tag $TIMESTAMP_TAG $COMMIT_HASH
git push origin $TIMESTAMP_TAG
- name: Get artifacts from build job
uses: actions/download-artifact@v4
with:
path: public
name: public
- name: List files in public
run: |
ls -lah .
ls -lah public
- name: Compress files
run: |
tar -czf pages.tar.gz public
ls -lah
- name: Make formatted release name
run: echo "RELEASE_NAME=$(date -d $COMMIT_TIMESTAMP '+%Y/%m/%d %H:%M:%S')" >> $GITHUB_ENV
- uses: actions/upload-pages-artifact@v3
with:
path: public
name: pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: pages
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ env.RELEASE_NAME }}
tag_name: ${{ env.TIMESTAMP_TAG }}
fail_on_unmatched_files: true
# target_commitish: ${{ env.COMMIT_HASH }}
generate_release_notes: true
files: pages.tar.gz