-
-
Notifications
You must be signed in to change notification settings - Fork 2
123 lines (111 loc) · 3.88 KB
/
deploy.yml
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Deployment Workflow
on:
push:
branches:
- main
release:
types: [published]
env:
PREVIEW_ENV: Preview
PRODUCTION_ENV: Production
jobs:
deploy_preview:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
environment:
name: Preview
url: https://adaleks.github.io/anywhere-ui-showcase-preview
steps:
- name: Checkout Main Project
uses: actions/checkout@v2
with:
path: anywhere-ui
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16.15.0
- name: Install dependencies
run: cd anywhere-ui && npm ci && npm run install-all && npm install grunt -g
- name: Build Code
run: |
cd anywhere-ui
npm run build.core
cd packages/core && node scripts/docs.js anywhere-ui-showcase-preview
- name: Checkout Preview Project
uses: actions/checkout@master
with:
repository: adaleks/anywhere-ui-showcase-preview
token: ${{ secrets.ACCESS_TOKEN }}
path: ./anywhere-ui-showcase-preview
- name: Copy/Create file
run: |
FILES=./anywhere-ui/packages/core/www
if [ -d "$FILES" ]; then
echo "Copying $FILES"
cp -R ./anywhere-ui/packages/core/www/* ./anywhere-ui-showcase-preview
else
echo "There is no www folder. Make sure that you build site."
fi
- name: Push Deployment Preview project
run: |
cd ./anywhere-ui-showcase-preview
git add .
if ! git diff-index --quiet HEAD; then
git config user.name gjovanovicst
git config user.email [email protected]
git commit -am "File Replicated from anywhere-ui"
git push
else
echo "Nothing to commit, working tree clean"
fi
deploy_production:
runs-on: ubuntu-latest
# needs: deploy_preview
if: startsWith(github.ref_name, 'v')
environment:
name: Production
url: https://adaleks.github.io/anywhere-ui-showcase-production
steps:
- name: Checkout Main Project
uses: actions/checkout@v2
with:
path: anywhere-ui
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16.15.0
- name: Install dependencies
run: cd anywhere-ui && npm ci && npm run install-all && npm install grunt -g
- name: Build Code
run: |
cd anywhere-ui
grunt buildnumber && grunt release:build && node packages/core/scripts/update-template-version.js
npm run build.core
cd packages/core && node scripts/docs.js anywhere-ui-showcase-production
- name: Checkout Production Project
uses: actions/checkout@master
with:
repository: adaleks/anywhere-ui-showcase-production
token: ${{ secrets.ACCESS_TOKEN }}
path: ./anywhere-ui-showcase-production
- name: Copy/Create file
run: |
FILES=./anywhere-ui/packages/core/www
if [ -d "$FILES" ]; then
echo "Copying $FILES"
cp -R ./anywhere-ui/packages/core/www/* ./anywhere-ui-showcase-production
else
echo "There is no www folder. Make sure that you build site."
fi
- name: Push Deployment Production project
run: |
cd ./anywhere-ui-showcase-production
git add .
if ! git diff-index --quiet HEAD; then
git config user.name gjovanovicst
git config user.email [email protected]
git commit -am "File Replicated from anywhere-ui"
git push
else
echo "Nothing to commit, working tree clean"
fi