Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #17

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #17

Workflow file for this run

name: Build Docs
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Authenticate in GitHub docker registry
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin
- name: Pull latest cached docker image
run: |
docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/db-load-generator:latest
- name: Download SQLite driver JAR binary for tutorial section of docs
env:
SOURCE_URL: https://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.34.0
FILENAME: sqlite-jdbc-3.34.0.jar
run: |
curl -sL "${SOURCE_URL}/${FILENAME}" > "docs/${FILENAME}"
- name: Build the docs
run: |
docker run \
-v "$(pwd)":/app \
docker.pkg.github.com/$GITHUB_REPOSITORY/db-load-generator:latest \
make -C docs rebuild
- name: Cache built docs as artifact
uses: actions/upload-artifact@v2
with:
name: rendered-docs
path: |
docs/_build/html/**
upload-docs:
runs-on: ubuntu-latest
needs:
- build-docs
steps:
- name: Download built docs as cached artifact
uses: actions/download-artifact@v4.1.7
with:
name: rendered-docs
- name: Change Git username for gh-pages branch
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Initialize gh-pages branch
run: |
git init
git remote add deploy "https://token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
git checkout -b gh-pages
- name: Add README disclaimer
run: |
echo '# GitHub Pages for `db-load-generator`' > README.md
echo "" >> README.md
echo "The contents of this branch are built using GitHub Actions workflow and Sphinx." >> README.md
echo "" >> README.md
echo "See built docs at [dbload.org](https://dbload.org)" >> README.md
echo "" >> README.md
echo "*commit ${GITHUB_SHA:0:6}*" >> README.md
- name: Add .nojekyll file to prevent the contents from being built by GitHub pages second time
run: |
touch .nojekyll
- name: Add CNAME file
run: |
echo "dbload.org" > CNAME
- name: Push everything to gh-pages branch on GitHub
run: |
git add .
git commit -m "📝 Rebuilt docs: commit ${GITHUB_SHA:0:6}"
git push deploy gh-pages --force