Allow building without PostgreSQL or SQLite backend #15679
Workflow file for this run
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: Docs | |
on: | |
pull_request: | |
types: | |
- unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild | |
- opened | |
- reopened | |
- synchronize | |
push: | |
branches: | |
- main | |
- releases/* | |
schedule: | |
- cron: "12 0 * * *" | |
# Do not run this workflow in parallel for any PR change or branch push | |
# to prevent concurrent deployments to GitHub Pages. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
cancel-in-progress: false | |
env: | |
GOPATH: /home/runner/go | |
GOCACHE: /home/runner/go/cache | |
GOLANGCI_LINT_CACHE: /home/runner/go/cache/lint | |
GOMODCACHE: /home/runner/go/mod | |
GOPROXY: https://proxy.golang.org | |
GOTOOLCHAIN: local | |
jobs: | |
build: | |
name: Build docs | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready') | |
steps: | |
- name: Setup permissions monitoring | |
uses: GitHubSecurityLab/actions-permissions/monitor@v1 | |
if: false | |
# TODO https://github.com/FerretDB/github-actions/issues/211 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
# This step will fail with "Error: Resource not accessible by integration" | |
# while trying to add label and comment to PR, that is not possible for PRs from forks. | |
# See https://github.com/ppremk/lfs-warning/issues/147. | |
# But the real issue will be right above that message: a list of files that should be added using Git LFS. | |
- name: Check LFS status | |
uses: ppremk/lfs-warning@v3.2 | |
with: | |
filesizelimit: 102400b | |
labelName: use-git-lfs | |
exclusionPatterns: | | |
**/*.js | |
**/*.md | |
**/go.sum | |
- name: Setup Go | |
uses: FerretDB/github-actions/setup-go@main | |
with: | |
cache-key: docs | |
- name: Install Task | |
run: go generate -x | |
working-directory: tools | |
- name: Build tools | |
run: bin/task env-pull | |
- name: Build docs | |
run: bin/task docs | |
- name: Create directory | |
run: mkdir tmp | |
- name: Archive docs | |
run: > | |
tar --directory website/build | |
--file tmp/docs.tar | |
--create | |
--verbose | |
. | |
# it has to be exactly "docs.tar" for actions/deploy-pages below | |
- name: Upload archive artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docs | |
path: tmp/docs.tar | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Check dirty | |
run: | | |
git status | |
git diff --exit-code | |
github: | |
name: Deploy to GitHub Pages | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
# deploy only on push to main; exclude pull_request and schedule | |
needs: build | |
if: github.event_name == 'push' | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deploy.outputs.page_url }} | |
steps: | |
- name: Setup permissions monitoring | |
uses: GitHubSecurityLab/actions-permissions/monitor@v1 | |
if: false | |
- name: Deploy to GitHub Pages | |
id: deploy | |
uses: actions/deploy-pages@v2 | |
with: | |
artifact_name: docs | |
timeout: 300000 # 5*60*1000 milliseconds |