Skip to content

Commit 0499933

Browse files
committed
update workflow
1 parent ba041c9 commit 0499933

File tree

3 files changed

+36
-54
lines changed

3 files changed

+36
-54
lines changed

.github/workflows/build-for-netlify.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Preview Site Wrapper
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on pull request events but only for the master branch
6+
pull_request:
7+
branches: [ master ]
8+
types: [opened, synchronize, edited, reopened]
9+
10+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
11+
jobs:
12+
# This workflow contains a single job called "build-for-netlify"
13+
build-for-netlify:
14+
# The type of runner that the job will run on
15+
runs-on: ubuntu-18.04
16+
17+
# Steps represent a sequence of tasks that will be executed as part of the job
18+
steps:
19+
- name: Triger Inner workflow
20+
run: echo "triger inner workflow"

.github/workflows/deploy-to-netlify.yml renamed to .github/workflows/preview-site.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Deploy to Netlify
44
on:
55
workflow_run:
66
workflows:
7-
- Build for Netlify
7+
- Preview Site Wrapper
88
types:
99
- completed
1010

@@ -14,22 +14,24 @@ jobs:
1414
deploy-to-netlify:
1515
# The type of runner that the job will run on
1616
runs-on: ubuntu-18.04
17-
1817
# Steps represent a sequence of tasks that will be executed as part of the job
1918
steps:
20-
- uses: actions/checkout@v2
21-
- name: Download Artifact Docs
22-
uses: dawidd6/action-download-artifact@v2
19+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
20+
- name: Checkout
21+
uses: actions/[email protected] # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
22+
with:
23+
persist-credentials: false
24+
- name: Set up Python
25+
uses: actions/setup-python@v2
2326
with:
24-
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
workflow: build-for-netlify.yml
26-
run_id: ${{ github.event.workflow_run.id }}
27-
name: site-zip
28-
- name: Unzip Site
29-
run: |
30-
rm -rf ./site
31-
unzip site.zip
32-
rm -f site.zip
27+
python-version: '3.8'
28+
- name: Install requirements
29+
run: python3.8 -m pip install -r requirements.txt
30+
- name: Install Material Insiders
31+
if: github.event.pull_request.head.repo.fork == false
32+
run: python3.8 -m pip install git+https://${{ secrets.ACCESS_TOKEN }}@github.com/iromise/mkdocs-material-insiders.git
33+
- name: Build Docs
34+
run: python3.8 ./scripts/docs.py build-all
3335
- name: Deploy to Netlify
3436
id: netlify
3537
uses: nwtgck/[email protected]

0 commit comments

Comments
 (0)