forked from refinedev/refine
-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (161 loc) · 6.5 KB
/
next-push.yml
File metadata and controls
167 lines (161 loc) · 6.5 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
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: next Release
on:
push:
paths:
- ".changeset/**"
- "packages/**"
- "documentation/**"
branches:
- next
jobs:
publish:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
node-version: [16.x]
steps:
- name: Workflow run cleanup action
uses: rokroskar/workflow-run-cleanup-action@v0.2.2
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 }}
registry-url: https://registry.npmjs.org/
- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install Dependencies & Build
run: |
npm ci
npm run bootstrap
npm run lerna run build -- --scope @pankod/refine-codemod
- name: Lint
run: npm run lint
- name: Test
run: npm test
- name: Copy changesets for Stable version
run: mkdir -p ./_changeset/ && cp -r ./.changeset/* ./_changeset/
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: npm run changeset version
publish: npm run changeset publish -- --tag next
commit: "ci(changesets): next version packages"
title: "ci(changesets): next version packages"
createGithubReleases: false
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.PANKOD_BOT_TOKEN }}
documentation-live-preview:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
node-version: [16.x]
steps:
- name: Workflow run cleanup action
uses: rokroskar/workflow-run-cleanup-action@v0.2.2
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: live previews docker build
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
repository: refinedev/refine/refine-live-preview
dockerfile: packages/live-previews/Dockerfile
tag_with_sha: true
- name: Set up kubectl
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: Deploy refine-live-previews-documentation to k8s
run: |
cd packages/live-previews
mv ./k8s/live-previews/Chart.yaml ./k8s/live-previews/Chart.old.yaml &&
cat ./k8s/live-previews/Chart.old.yaml | grep -v appVersion > ./k8s/live-previews/Chart.yaml &&
echo -e "\r\nappVersion: sha-${GITHUB_SHA::7}\r\n" >> ./k8s/live-previews/Chart.yaml &&
cat ./k8s/live-previews/Chart.yaml
helm upgrade refine-next-live-previews-documentation ./k8s/live-previews --install --atomic --timeout 20m0s --values=./k8s/live-previews/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].path="/" \
--set ingress.hosts[0].paths[0].pathType=ImplementationSpecific \
--set ingress.tls[0].secretName=${{ env.domain }} \
--set ingress.tls[0].hosts[0]=${{ env.domain }} \
env:
domain: "next.live-previews.refine.dev"
documentation:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
node-version: [16.x]
steps:
- name: Workflow run cleanup action
uses: rokroskar/workflow-run-cleanup-action@v0.2.2
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: documentation docker build
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
repository: refinedev/refine/refine-documentation
dockerfile: documentation/Dockerfile
tag_with_sha: true
- name: Set up kubectl
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: Deploy refine-documentation to k8s
run: |
cd documentation
mv ./k8s/refine-documentation/Chart.yaml ./k8s/refine-documentation/Chart.old.yaml &&
cat ./k8s/refine-documentation/Chart.old.yaml | grep -v appVersion > ./k8s/refine-documentation/Chart.yaml &&
echo -e "\r\nappVersion: sha-${GITHUB_SHA::7}\r\n" >> ./k8s/refine-documentation/Chart.yaml &&
cat ./k8s/refine-documentation/Chart.yaml
helm delete refine-next-documentation || :
helm upgrade refine-next-documentation ./k8s/refine-documentation --install --atomic --timeout 20m0s --values=./k8s/refine-documentation/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].path="/" \
--set ingress.hosts[0].paths[0].pathType=ImplementationSpecific \
--set ingress.tls[0].secretName=${{ env.domain }} \
--set ingress.tls[0].hosts[0]=${{ env.domain }} \
env:
domain: "next.refine.dev"