Skip to content

Commit fdfb138

Browse files
committed
CI: GitHub: enable action to deploy
use public action https://github.com/marketplace/actions/github-pages-action to deploy HTML to our github.io repo when we make a push to publish branch Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
1 parent 74066cb commit fdfb138

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

.github/workflows/pull-request.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ name: GitHub Actions
1414
# yamllint disable-line rule:truthy
1515
on:
1616
push:
17-
branches: [master]
17+
branches:
18+
- master
19+
- publish
1820
pull_request:
1921
branches: [master]
2022

@@ -44,6 +46,39 @@ jobs:
4446
- name: build doc
4547
run: ./.github/actions/build-sof-doc.sh
4648

49+
- name: prepare file for deploy
50+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/publish' }}
51+
run: ./.github/actions/create-publish-folder.sh
52+
53+
# store the build result to artifact, used for later deploy or download for debug
54+
# https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts
55+
- name: upload HTML for deploy
56+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/publish' }}
57+
uses: actions/upload-artifact@v2
58+
with:
59+
name: html
60+
path: _build/html
61+
62+
deploy:
63+
needs: build-basic
64+
runs-on: ubuntu-20.04
65+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/publish' }}
66+
steps:
67+
- name: download HTML
68+
uses: actions/download-artifact@v2
69+
with:
70+
name: html
71+
path: html
72+
73+
- name: deploy
74+
uses: peaceiris/actions-gh-pages@v3
75+
with:
76+
personal_token: ${{ secrets.ACTIONS_DEPLOY_KEY }}
77+
publish_dir: ./html/
78+
publish_branch: master
79+
external_repository: thesofproject/thesofproject.github.io
80+
81+
4782
build-lax:
4883

4984
name: "build with requirements-lax.txt"

0 commit comments

Comments
 (0)