Skip to content

Commit

Permalink
Merge branch 'p/deploy-livedoc' of https://github.com/kwankyu/sage in…
Browse files Browse the repository at this point in the history
…to p/deploy-livedoc
  • Loading branch information
kwankyu committed Nov 3, 2023
2 parents a836b31 + a860efd commit 06d5cc8
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/doc-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,12 @@ jobs:

- name: Report deployment url
run: |
echo "::notice::The documentation has been deployed: ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}"
echo "::notice::The documentation has been deployed - ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}"
publish-livedoc:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'develop'
steps:
- name: Get information about workflow origin
uses: potiuk/get-workflow-origin@v1_5
id: source-run-info
with:
token: ${{ secrets.GITHUB_TOKEN }}
sourceRunId: ${{ github.event.workflow_run.id }}

- name: Download live doc
uses: actions/[email protected]
with:
Expand All @@ -124,25 +117,23 @@ jobs:
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/docs.zip', Buffer.from(download.data));
fs.writeFileSync('${{github.workspace}}/livedoc.zip', Buffer.from(download.data));
- name: Extract live doc
run: unzip livedoc.zip -d doc && unzip doc/livedoc.zip -d doc/livedoc
run: unzip livedoc.zip -d doc && unzip doc/livedoc.zip -d doc/doc

- name: Deploy to Netlify
id: deploy-netlify
uses: netlify/actions/cli@master
with:
args: deploy --dir=doc/livedoc --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS}
args: deploy --dir=doc/doc/livedoc --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_MESSAGE: ${{ steps.source-run-info.outputs.pullRequestNumber }}
NETLIFY_ALIAS: deploy-livedoc-${{ steps.source-run-info.outputs.pullRequestNumber }}
NETLIFY_MESSAGE: Deployed live doc
NETLIFY_ALIAS: deploy-livedoc

- name: Report deployment url
run: |
echo "::notice::The live documentation has been deployed: ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}"
echo "::notice::The live documentation has been deployed - ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}"

0 comments on commit 06d5cc8

Please sign in to comment.