Using github actions might actually push a change (#1603)

* Using github actions might actually push a change

* skip if not actually going to deploy

* Don't setup Pages if we aren't deploying

* skip deploy when not deploying
This commit is contained in:
James Hodgkinson 2023-05-07 12:44:30 +10:00 committed by GitHub
parent e6d23f1f4c
commit 5d54069e7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,6 +51,11 @@ jobs:
parent_id: ${{ github.ref }} parent_id: ${{ github.ref }}
deploy: deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'kanidm/kanidm' }}
needs: needs:
- fanout - fanout
- docs_master - docs_master
@ -61,7 +66,8 @@ jobs:
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: docs name: docs
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Extract the files - name: Extract the files
run: | run: |
find . -name '*.tar.gz' -exec tar zxf "{}" \; find . -name '*.tar.gz' -exec tar zxf "{}" \;
@ -71,9 +77,11 @@ jobs:
cd .. cd ..
ls -la docs/ ls -la docs/
- name: Deploy - name: Upload artifact
uses: peaceiris/actions-gh-pages@v3 uses: actions/upload-pages-artifact@v1
if: ${{ github.ref == 'refs/heads/master' }}
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} # Upload entire repository
publish_dir: ./docs path: 'docs/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2