Skip to content

Commit

Permalink
Merge pull request #61 from zowe/automatic-previews
Browse files Browse the repository at this point in the history
Use Workflow Dispatch
  • Loading branch information
awharn authored Mar 4, 2024
2 parents 06f8f6a + 6164d59 commit 085b4a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:

- name: Get Release Contents
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.ZOWE_ROBOT_TOKEN }}
run: |
gh release download ${{ github.event.inputs.zowe-version }} -p zowe-${{ github.event.inputs.zowe-version }}-WebHelp.zip
rm -rf docs/${{ github.event.inputs.zowe-version }}
Expand All @@ -149,6 +149,7 @@ jobs:
git add docs/${{ github.event.inputs.zowe-version }}
git commit -sm "Add Zowe Web Help ${{ github.event.inputs.zowe-version }}"
git push origin HEAD
gh workflow run -r gh-pages deploy-pages.yml
deploy-artifact:
needs: test
Expand All @@ -172,6 +173,8 @@ jobs:
path: docs/${{ github.ref_name }}

- name: Resolve Artifact
env:
GITHUB_TOKEN: ${{ secrets.ZOWE_ROBOT_TOKEN }}
run: |
mv docs/${{ github.ref_name }}/generatedWebHelp/* docs/${{ github.ref_name }}/.
rmdir docs/${{ github.ref_name }}/generatedWebHelp
Expand All @@ -181,6 +184,7 @@ jobs:
git add docs/${{ github.ref_name }}
git commit -sm "Add Zowe Web Help for ${{ github.ref_name }}"
git push origin HEAD
gh workflow run -r gh-pages deploy-pages.yml
deploy-pr:
needs: test
Expand All @@ -204,6 +208,8 @@ jobs:
path: docs/pr-${{ github.event.number }}

- name: Resolve Artifact
env:
GITHUB_TOKEN: ${{ secrets.ZOWE_ROBOT_TOKEN }}
run: |
mv docs/pr-${{ github.event.number }}/generatedWebHelp/* docs/pr-${{ github.event.number }}/.
rmdir docs/pr-${{ github.event.number }}/generatedWebHelp
Expand All @@ -213,6 +219,7 @@ jobs:
git add docs/pr-${{ github.event.number }}
git commit -sm "Add Zowe Web Help for PR ${{ github.event.number }}"
git push origin HEAD
gh workflow run -r gh-pages deploy-pages.yml
- name: Comment on PR
uses: marocchino/sticky-pull-request-comment@v2
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ jobs:
ref: 'gh-pages'

- name: Remove directory
env:
GITHUB_TOKEN: ${{ secrets.ZOWE_ROBOT_TOKEN }}
run: |
rm -rf docs/pr-${{ github.event.number }}
git config --global user.name ${{ secrets.ZOWE_ROBOT_USER }}
git config --global user.email ${{ secrets.ZOWE_ROBOT_EMAIL }}
git rm -r docs/pr-${{ github.event.number }}
git commit -sm "Remove Zowe Web Help for PR ${{ github.event.number }}"
git push origin HEAD
gh workflow run -r gh-pages deploy-pages.yml

0 comments on commit 085b4a7

Please sign in to comment.