Skip to content

Build site

Build site #96

Workflow file for this run

# For this to work, the Source for GitHub Pages needs to be set to GitHub Actions
# This setting is in Settings -> Pages on the repo GitHub page
name: Build site
'on':
workflow_dispatch: {}
push:
branches: [ main ]
paths:
- src/**
- data/**/*.dvc
- pipelines/**
- _config.ts
- deno.json
- .github/workflows/build-site.yml
workflow_run:
workflows: [Update data]
types: [completed]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Build job
build:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
env:
DENO_DIR: /var/tmp/deno_cache
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python
uses: ./.github/actions/setup-python-environment
- name: Setup deno
uses: ./.github/actions/setup-deno-environment
- name: Get current data
run: |
umask 077
eval $(ssh-agent -s)
echo "${{ secrets.DEPLOY_KEY }}" > deploy-key
ssh-add deploy-key
pipenv run dvc update data/published.dvc data/metadata.dvc
ssh-add -D
echo "${{ secrets.DEPLOY_KEY_HUQ }}" > deploy-key-huq
ssh-add deploy-key-huq
pipenv run dvc update data/huq.dvc
ssh-add -D
- name: Run pipelines
run: |
pipenv run dvc repro pipelines/dvc.yaml
- name: Build the site
run: deno task build
- uses: actions/upload-pages-artifact@v3
with:
path: _site/
# Deploy job
deploy:
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
# You need to set up GitHub Pages to deploy from an action
# See https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow for documentation
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4