Skip to content

Automatic update of nais application reference/example #3175

Automatic update of nais application reference/example

Automatic update of nais application reference/example #3175

Workflow file for this run

name: Build and publish doc
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # required for git date plugin
- name: Install poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: 3.11
architecture: x64
cache: poetry
- name: Install all dependencies
run: |
poetry sync \
--no-interaction \
--ansi
- name: Build documentation
run: |
./build.sh nav ssb test-nais ldir atil ci-nais dev-nais tenant
- name: Upload generated doc artifact
uses: actions/upload-artifact@v6
with:
name: out-folder
path: out # This uploads all the files in the out folder, not the folder itself
publish:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
tenant:
- name: ci-nais
bucket: doc.ci-nais.cloud.nais.io
- name: dev-nais
bucket: doc.dev-nais.cloud.nais.io
- name: nav
bucket: doc.nav.cloud.nais.io
- name: nav
bucket: docs.nais.io
- name: ssb
bucket: doc.ssb.cloud.nais.io
- name: test-nais
bucket: doc.test-nais.cloud.nais.io
- name: ldir
bucket: doc.ldir.cloud.nais.io
- name: atil
bucket: doc.atil.cloud.nais.io
steps:
- name: Download generated doc artifact
uses: actions/download-artifact@v7
with:
name: out-folder
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v3
with:
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
service_account: [email protected]
token_format: access_token
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v3
- name: Sync documentation to bucket
run: gsutil -m rsync -r -c -d ${{matrix.tenant.name}}/ gs://${{ matrix.tenant.bucket }}
- name: Invalidate cache
run: gsutil -m setmeta -r -h 'Cache-Control:public, max-age=180' 'gs://${{ matrix.tenant.bucket }}/*'