-
Notifications
You must be signed in to change notification settings - Fork 26
91 lines (81 loc) · 2.87 KB
/
main.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
name: Main workflow
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
verify:
uses: ./.github/workflows/verify.yml
build-preview:
needs: [ verify ]
uses: ./.github/workflows/build.yml
with:
build-env: preview
secrets:
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
DOCKER_REGISTRY_ADDRESS: ${{ secrets.DOCKER_REGISTRY_ADDRESS }}
DOCKER_REGISTRY_NAMESPACE: ${{ secrets.DOCKER_REGISTRY_NAMESPACE }}
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
OSS_ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
OSS_ACCESS_SECRET: ${{ secrets.OSS_ACCESS_SECRET }}
build-production:
needs: [ verify ]
if: ${{ github.event_name == 'push' }}
uses: ./.github/workflows/build.yml
with:
build-env: production
secrets:
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
DOCKER_REGISTRY_ADDRESS: ${{ secrets.DOCKER_REGISTRY_ADDRESS }}
DOCKER_REGISTRY_NAMESPACE: ${{ secrets.DOCKER_REGISTRY_NAMESPACE }}
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
OSS_ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
OSS_ACCESS_SECRET: ${{ secrets.OSS_ACCESS_SECRET }}
deploy-preview:
needs: [ build-preview ]
uses: ./.github/workflows/deploy-k8s.yml
with:
build-env: preview
secrets:
JUMP_SERVER_IP: ${{ secrets.JUMP_SERVER_IP }}
JUMP_SERVER_USER: ${{ secrets.JUMP_SERVER_USER }}
JUMP_SERVER_PATH: ${{ secrets.JUMP_SERVER_PATH }}
JUMP_SERVER_PRIVATE_KEY: ${{ secrets.JUMP_SERVER_PRIVATE_KEY }}
deploy-production:
needs: [ build-production ]
uses: ./.github/workflows/deploy-k8s.yml
with:
build-env: production
secrets:
JUMP_SERVER_IP: ${{ secrets.JUMP_SERVER_IP }}
JUMP_SERVER_USER: ${{ secrets.JUMP_SERVER_USER }}
JUMP_SERVER_PATH: ${{ secrets.JUMP_SERVER_PATH }}
JUMP_SERVER_PRIVATE_KEY: ${{ secrets.JUMP_SERVER_PRIVATE_KEY }}
preview-pages-test:
needs: [ deploy-preview ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.9.0
uses: actions/setup-node@v3
with:
node-version: 20.9.0
cache: 'npm'
- name: Cache dependencies
id: dep-caches
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
!packages/ui/node_modules
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json', 'packages/*/package-lock.json', '!packages/ui/node_modules') }}
restore-keys: ${{ runner.os }}-build
- name: Run page tests
run: node testurls.mjs
env:
NEXT_PUBLIC_HOME_URL: https://community-preview.tidb.net