Skip to content

Update github & gitlab tokens #4514

Update github & gitlab tokens

Update github & gitlab tokens #4514

Workflow file for this run

name: Docs CI
on:
push:
pull_request:
jobs:
lint:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.0
with:
# Need this to get version number from last tag
fetch-depth: 0
- name: Set node
uses: actions/setup-node@v4.0.4
with:
node-version: 18
- name: Install yarn dependencies
uses: borales/actions-yarn@v5.0.0
with:
cmd: global add markdownlint-cli2 markdown-it-admon
- name: Lint with markdownlint-cli2
run: >
markdownlint-cli2
**/*.{md,markdown}
build:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.0
with:
# Need this to get version number from last tag
fetch-depth: 0
- name: Setup python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.11
- name: Install docs dependencies
run: pip install -r docs/requirements.txt
- name: Set node
uses: actions/setup-node@v4.0.4
with:
node-version: 18.x
- name: Generate docs
run: npx @techdocs/cli generate --no-docker --omitTechdocsCoreMkdocsPlugin
- name: Create docs artifact
uses: actions/upload-artifact@v4.4.0
with:
name: techdocs-common
path: site
publish_gh_pages:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs: build
runs-on: ubuntu-latest
steps:
- name: Get docs artifact
uses: actions/download-artifact@v4.1.8
with:
name: techdocs-common
path: site
- name: Publish docs to gh-pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site
keep_files: true
publish_s3:
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository)
needs: build
strategy:
matrix:
entity:
- default/system/developer-portal
- default/component/developer-portal-backend
- default/component/developer-portal-frontend
runs-on: ubuntu-latest
steps:
- name: Get docs artifact
uses: actions/download-artifact@v4.1.8
with:
name: techdocs-common
path: site
- name: Publish docs to s3 bucket
if: github.ref == 'refs/heads/main'
run: >
timeout -v 10m
npx @techdocs/cli publish
--entity ${{ matrix.entity }}
--publisher-type awsS3
--storage-name techdocs
--awsEndpoint https://s3.echo.stfc.ac.uk
--awsS3ForcePathStyle
env:
AWS_ACCESS_KEY_ID: ${{ secrets.TECHDOCS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TECHDOCS_S3_SECRET_ACCESS_KEY }}
AWS_REGION: "eu-west-2"