Allow reading ids containing integers as strings (#4076) #1
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: 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 [email protected] | |
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 |