Skip to content

Simple public source page #13631

Simple public source page

Simple public source page #13631

name: Build/deploy docs
on:
push:
branches:
- main
pull_request:
jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
timeout-minutes: 60
if: github.repository_owner == 'skyportal'
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: skyportal
POSTGRES_PASSWORD: anything
ports:
- 5432:5432
# needed because the postgres container does not provide a
# healthcheck
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v2
with:
path: |
~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package.json') }}
- uses: actions/cache@v2
with:
path: |
~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Write SkyPortal config
run: |
cat << EOF > config.yaml
database:
database: skyportal
host: localhost
port: 5432
user: skyportal
password: anything
EOF
- name: Install system dependencies
run: |
sudo apt update -y
sudo apt install -y libcurl4-gnutls-dev libgnutls28-dev
python -m pip install pip==23.1.2
pip install numpy wheel
pip install -r baselayer/requirements.txt
pip install -r requirements.txt
export NPM_PACKAGES="${HOME}/.npm-packages"
export PATH=${NPM_PACKAGES}/bin:$PATH
export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
sudo npm -g install npm@latest
- name: Checkout branch being tested
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
clean: false
- name: Build docs
run: |
make docs
touch doc/_build/html/.nojekyll
- name: Install SSH Client 🔑
if: github.ref == 'refs/heads/main'
uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.CI_DEPLOY_KEY }}
- name: Deploy docs
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
FOLDER: doc/_build/html
REPOSITORY_NAME: skyportal/docs
BRANCH: gh-pages
SSH: true