-
Notifications
You must be signed in to change notification settings - Fork 16
81 lines (76 loc) · 2.54 KB
/
release.yaml
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
name: release
on:
release:
types: ["created"]
push:
branches: ["main"]
jobs:
CICD:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16.x']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: build
run: |
yarn
yarn build
- name: Deploy to server
env:
KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh/ && echo "$KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
scp -o StrictHostKeyChecking=no -r ./build/* ${{ secrets.DEPLOY_HOST }}
Release-DongTai-Infra-Service:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16.x']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DONGTAI_DOCKERHUB_USERNAME }}
password: ${{ secrets.DONGTAI_DOCKERHUB_TOKEN }}
- name: Login to Aliyun Registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.ALIYUN_REGISTRY }}
username: ${{ secrets.ALIYUN_DOCKERHUB_USER }}
password: ${{ secrets.ALIYUN_DOCKERHUB_PASSWORD }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: build
run: |
sed -i "s#custom.css#custom1.css#g" docusaurus.config.js
sed -i "s#baseUrl: '/'#baseUrl: '/dongtai_doc/'#g" docusaurus.config.js
yarn
yarn build
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
dongtai/dongtai-doc-v5:latest
dongtai/dongtai-doc-v5:0.0.${{github.run_number}}
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-doc:latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-doc:max-develop-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-doc:max-beta-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-doc:max-main-latest