Host site at GitHub pages #4
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: build_deploy | |
on: | |
push: | |
branches: master | |
pull_request: | |
repository_dispatch: | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to 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. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
build: | |
name: Build site | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup prerequisites | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl make libxml2-dev libxslt-dev npm openssl | |
- name: Setup snaps | |
run: | | |
sudo snap install yq | |
sudo snap install aws-cli --classic | |
sudo snap install node --classic --channel=10/stable | |
- name: Use Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.6' | |
architecture: 'x64' | |
bundler: '2.2.31' | |
- uses: actions/checkout@master | |
- name: Setup git submodules | |
# env: | |
# MLGT_DATA_DEPLOY_KEY: ${{ secrets.MLGT_DATA_DEPLOY_KEY }} | |
# GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no" | |
run: | | |
# eval "$(ssh-agent -s)" | |
# ssh-add - <<< "${MLGT_DATA_DEPLOY_KEY}" | |
make update-init update-modules | |
- name: Update gems | |
run: | | |
bundle install --jobs 4 --retry 3 | |
- name: Setup npm | |
run: | | |
npm install | |
- name: Build site | |
run: | | |
make _site | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
if: ${{ github.ref == 'refs/heads/master' }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |