Skip to content

Bump express from 4.18.2 to 4.19.2 in /docs2 (#3939) #198

Bump express from 4.18.2 to 4.19.2 in /docs2 (#3939)

Bump express from 4.18.2 to 4.19.2 in /docs2 (#3939) #198

name: Publish documentation
on:
push:
branches:
- master
paths:
- docs2/**
- package.json
- yarn.lock
- .github/workflows/publish-documentation.yml
env:
NODE_VERSION: '18.x' # Node 18 LTS, see https://nodejs.org/en/about/releases/
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
path: main
- name: Checkout publish target
uses: actions/checkout@v4
with:
repository: graphql-dotnet/graphql-dotnet.github.io
token: ${{ secrets.ORG_PAT_TOKEN }}
path: published
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: yarn docs2
working-directory: main/docs2
run: yarn
- name: yarn gatsby build
working-directory: main/docs2
run: yarn gatsby build
- name: Publish docs artifacts
uses: actions/upload-artifact@v4
with:
name: Documentation
path: main/docs2/public/**
if-no-files-found: error
- name: Commit docs
shell: bash
run: |
rsync -a --quiet --delete --exclude ".git" "main/docs2/public/" "published/" || exit 1
cd published
git config user.name github-actions
git config user.email github-actions@graphql-dotnet.net
git add --all
err=$(git status 2>&1)
str="nothing to commit, working tree clean"
if [[ "$err" == *"$str"* ]]; then
echo "Documentation files are up to date, nothing to commit/push"
else
git commit -a -m "Documentation update"
git push
fi