-
-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'p/deploy-livedoc' of https://github.com/kwankyu/sage in…
…to p/deploy-livedoc
- Loading branch information
Showing
1 changed file
with
7 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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 }}" | ||