Skip to content

[probes.external] Fix serverutils. (#748) #327

[probes.external] Fix serverutils. (#748)

[probes.external] Fix serverutils. (#748) #327

Workflow file for this run

name: Build and deploy gh-pages
on:
push:
paths:
- 'docs/**'
- '**proto/*.proto'
- '.github/workflows/hugo.yml'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: 'docs/package-lock.json'
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
id: go
- name: Setup public worktree
run: cd docs && git worktree add public gh-pages
- name: Create a branch for pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd docs/public
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git push origin --delete gh-pages-github-action || true
git checkout -b gh-pages-github-action gh-pages
- name: Build pages
run: |
make config_docs
cd docs
npm install
npm run build
ls public
cd public && git status
- name: Deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd docs/public
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git add --all
git status
git diff-index --quiet HEAD || git commit -m "Update gh-pages" && git push --set-upstream origin gh-pages-github-action