Update target branch for documentation workflow

This commit is contained in:
eikendev 2022-02-13 11:42:43 +01:00
parent 7e2193bd07
commit 56f39cf64c
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694

View file

@ -10,13 +10,16 @@ on:
- '**.yaml'
- '**.json'
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
jobs:
build_documentation:
name: Build documentation
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ github.ref == 'refs/heads/master' }}
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Checkout the repository
uses: actions/checkout@v2
@ -41,15 +44,11 @@ jobs:
run: npx redoc-cli bundle docs/swagger.yaml --output index.html
- name: Setup SSH keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.WEBSITE_DEPLOY_KEY }}"
- name: Checkout website
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: mkdir website && git clone git@github.com:pushbits/website.git website
- name: Copy index.html
@ -59,8 +58,6 @@ jobs:
run: git config --global user.email "pipeline@pushbits.io" && git config --global user.name "PushBits Pipeline"
- name: Commit and push
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
cd website
git diff --quiet || ( git add . && git commit -m "Update documentation to ${{ github.sha }}" && git push )