diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e21fca9..46b1f9b 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -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 )