-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·108 lines (95 loc) · 3.24 KB
/
deploy.yml
File metadata and controls
executable file
·108 lines (95 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Build and Deploy
on:
push:
branches: [master]
pull_request:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- name: PlatIAgro - Checkout 🛎️
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Code review tips
uses: machine-learning-apps/pr-comment@master
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: CODE-REVIEW.md
- name: Download claat and Add to Path
run: |
mkdir -p $GITHUB_WORKSPACE/bin
wget -O $GITHUB_WORKSPACE/bin/claat https://github.com/googlecodelabs/tools/releases/download/v2.2.4/claat-linux-amd64
echo "::add-path::$GITHUB_WORKSPACE/bin"
chmod +x $GITHUB_WORKSPACE/bin/claat
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: Build - Codelabs 🔧
id: codelabs
run: |
mkdir -p codelabs-html
cd codelabs-html
find ../codelabs | grep .md$ | xargs -L1 claat export
CODELAB_DIRS=$(ls)
echo ::set-output name=CODELAB_DIRS::${CODELAB_DIRS}
- name: Build - Tutorials Site 🔧 # This example project is built using gulp and outputs the result to the 'dist' folder.
run: |
yarn
./node_modules/.bin/gulp dist --base-url https://platiagro.github.io/tutorials --codelabs-dir codelabs-html/
rm -rf dist/codelabs
mkdir -p dist/codelabs
cd codelabs-html
mv ${{ steps.codelabs.outputs.CODELAB_DIRS }} ../dist/codelabs/
- name: Build - Machine Failure WebApp 🔧
run: |
mkdir -p dist
cd machine-failure
yarn
yarn build
mv build ../dist/machine-failure
env:
PUBLIC_URL: https://platiagro.github.io/tutorials/machine-failure/
- name: Build - Machine Failure Dojot WebApp 🔧
run: |
mkdir -p dist
cd machine-failure-dojot
yarn
yarn build
mv build ../dist/machine-failure-dojot
env:
PUBLIC_URL: https://platiagro.github.io/tutorials/machine-failure-dojot/
- name: Build - Fruit Prices WebApp 🔧
run: |
mkdir -p dist
cd fruit-prices
yarn
yarn build
mv build ../dist/fruit-prices
env:
PUBLIC_URL: https://platiagro.github.io/tutorials/fruit-prices/
- name: Build - Irrigation WebApp 🔧
run: |
mkdir -p dist
cd irrigation
yarn
yarn build
mv build ../dist/irrigation
env:
PUBLIC_URL: https://platiagro.github.io/tutorials/irrigation/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: dist # The folder the action should deploy.