Skip to content

fix vars

fix vars #5678

Workflow file for this run

name: build PyQGIS API docs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false
on:
schedule:
# runs once a week
- cron: '0 0 * * 0'
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-docs:
name: Build PyQGIS docs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
qgis_version: [ 'master', 'stable', 'ltr' ]
outputs:
QGIS_VERSIONS_LIST: ${{ steps.version.outputs.QGIS_VERSIONS_LIST }}
steps:
- uses: actions/checkout@v4
- id: version
name: determine version
run: |
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq && chmod +x yq
QGIS_CURRENT_LTR=$(yq .current_ltr pyqgis_conf.yml)
QGIS_CURRENT_STABLE=$(yq .current_stable pyqgis_conf.yml)
QGIS_VERSION=$(yq --exit-status .${{ matrix.qgis_version }} pyqgis_conf.yml) || QGIS_VERSION=$(echo "master")
vars=("QGIS_VERSION" "QGIS_CURRENT_STABLE" "QGIS_CURRENT_LTR")
for var in "${vars[@]}"; do
echo "${var}=${!var}"
echo "${var}=${!var}" >> "$GITHUB_OUTPUT"
echo "${var}=${!var}" >> "GITHUB_ENV"
done
- name: Build PyQGIS docs
if: ${{ github.event_name != 'pull_request' || matrix.qgis_version == 'master' }}
run: |
./scripts/run-docker.sh -v ${QGIS_VERSION}
- uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' || matrix.qgis_version == 'master' }}
with:
name: ${{ matrix.qgis_version }}
path: ./build/
publish-docs:
if: ${{ github.event_name != 'pull_request' }}
name: Publish HTML
runs-on: ubuntu-latest
needs: build-docs
steps:
- uses: actions/checkout@v4
- name: Get artifact for master
uses: actions/download-artifact@v4
with:
name: master
merge-multiple: true
- name: Get artifact for stable
if: ${{ github.event_name != 'pull_request' }}
uses: actions/download-artifact@v4
with:
name: stable
merge-multiple: true
- name: Get artifact for ltr
if: ${{ github.event_name != 'pull_request' }}
uses: actions/download-artifact@v4
with:
name: ltr
merge-multiple: true
- name: Deploy
env:
STABLE: ${{ needs.build-docs.outputs.QGIS_CURRENT_STABLE }}
LTR: ${{ needs.build-docs.outputs.QGIS_CURRENT_LTR }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: ./scripts/publish-docs.sh "master,${STABLE},${LTR}"