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