Deploy static content to Pages #127
This file contains 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: Deploy static content to Pages | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Download artifact | |
id: download-artifact | |
uses: dawidd6/action-download-artifact@v7 | |
with: | |
name: artifact | |
path: app/public/history | |
# - name: Cache prior coverage data | |
# uses: actions/cache/restore@v4 | |
# with: | |
# path: app/public/history | |
# key: coverage-data-v4 | |
- name: Build | |
run: | | |
git submodule update --recursive --init --remote --merge deno | |
deno run --allow-all main.ts | |
DATE=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z") | |
cp app/public/tests.json app/public/history/$(date -u +"%Y-%m-%dT%H_%M_%S.000Z").json | |
echo $(date -u +"%Y-%m-%dT%H:%M:%S.000Z") >> app/public/history/index.txt | |
cd app | |
npm install | |
npm run build | |
# - name: Update prior coverage data cache | |
# uses: actions/cache/save@v4 | |
# with: | |
# path: app/public/history | |
# key: coverage-data-v4 | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: app/public/history | |
- name: Update GitHub Pages | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './app/build' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |