forked from refinedev/refine
-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (147 loc) · 5.72 KB
/
master-push.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Publish Master
on:
push:
branches:
- master
jobs:
admin-example:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: Workflow run cleanup action
uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get current time
uses: 1466587594/get-current-time@v1
id: current-time
with:
format: DDMMHm
utcOffset: "+03:00"
- name: web docker build
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: docker.pkg.github.com
repository: pankod/refine/refine-example
tags: sha-${{ steps.current-time.outputs.formattedTime }}
dockerfile: examples/fineFoods/admin/Dockerfile
- name: Set up kubectl
uses: matootie/[email protected]
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: Deploy refine-example to k8s
run: |
cd examples/fineFoods/admin
echo ${{ env.domain }}
mv ./k8s/refine-example/Chart.yaml ./k8s/refine-example/Chart.old.yaml &&
cat ./k8s/refine-example/Chart.old.yaml | grep -v appVersion > ./k8s/refine-example/Chart.yaml &&
echo -e "\r\nappVersion: sha-${{ steps.current-time.outputs.formattedTime }}\r\n" >> ./k8s/refine-example/Chart.yaml &&
cat ./k8s/refine-example/Chart.yaml
helm upgrade refine-example ./k8s/refine-example --install --values=./k8s/refine-example/values.yaml \
--set ingress.enabled=true \
--set ingress.annotations."kubernetes\.io/ingress\.class"=nginx \
--set ingress.annotations."cert-manager\.io/issuer"=letsencrypt-prod \
--set ingress.hosts[0].host=${{ env.domain }} \
--set ingress.hosts[0].paths[0]="/" \
--set ingress.tls[0].secretName=${{ env.domain }} \
--set ingress.tls[0].hosts[0]=${{ env.domain }} \
env:
domain: "example.admin.refine.dev"
- name: Send custom variable to Meercode Build
uses: meercodeio/[email protected]
with:
meercode-token: ${{ secrets.MEERCODE_TOKEN }}
url: "https://example.admin.refine.dev"
client-example:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Workflow run cleanup action
uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: client docker build
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: docker.pkg.github.com
repository: pankod/refine/refine-client-example
tag_with_sha: true
dockerfile: examples/fineFoods/client/Dockerfile
- name: Set up kubectl
uses: matootie/[email protected]
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: Deploy refine-example to k8s
run: |
cd examples/fineFoods/client
mv ./k8s/refine-example/Chart.yaml ./k8s/refine-example/Chart.old.yaml &&
cat ./k8s/refine-example/Chart.old.yaml | grep -v appVersion > ./k8s/refine-example/Chart.yaml &&
echo -e "\r\nappVersion: sha-${GITHUB_SHA::7}\r\n" >> ./k8s/refine-example/Chart.yaml &&
cat ./k8s/refine-example/Chart.yaml
helm upgrade client-refine-example ./k8s/refine-example --install --atomic --values=./k8s/refine-example/values.yaml \
--set ingress.enabled=true \
--set ingress.annotations."kubernetes\.io/ingress\.class"=nginx \
--set ingress.annotations."cert-manager\.io/issuer"=letsencrypt-prod \
--set ingress.hosts[0].host=${{ env.domain }} \
--set ingress.hosts[0].paths[0]="/" \
--set ingress.tls[0].secretName=${{ env.domain }} \
--set ingress.tls[0].hosts[0]=${{ env.domain }} \
env:
domain: "example.refine.dev"
documentation-gh:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Add key to allow access to repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
cat <<EOT >> ~/.ssh/config
Host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa
EOT
- name: Release to GitHub Pages
env:
USE_SSH: true
GIT_USER: pankod-bot
run: |
cd documentation
git config --global user.email "[email protected]"
git config --global user.name "pankod-bot"
npm install
npm run deploy