-
Notifications
You must be signed in to change notification settings - Fork 24
70 lines (62 loc) · 2.17 KB
/
pre-cd.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
name: pre-cd
on:
workflow_dispatch:
inputs:
version:
description: 'Document Version'
required: true
default: 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ACTIONTOKEN }}
ref: ${{ github.event.inputs.version }}
- uses: actions/setup-python@v4
with:
python-version: '3.10.9'
- name: Intialiaze Python Env
run: |
git rev-parse --abbrev-ref HEAD
pip install -r requirements.txt
- name: Mike Dev Version Snapshot
if: ${{ github.event.inputs.version == 'main' }}
run: |
git fetch --all
git reset --hard origin/main
git pull
git config --global user.email ${{ secrets.GITUSEREMAIL }}
git config --global user.name ${{ secrets.GITUSERNAME }}
mike deploy --push dev
- name: Mike Release Version Snapshot
if: ${{ github.event.inputs.version != 'main' }}
run: |
git fetch --all
git config --global user.email ${{ secrets.GITUSEREMAIL }}
git config --global user.name ${{ secrets.GITUSERNAME }}
mike deploy --push ${{ github.event.inputs.version }}
- name: Login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login Tencent Container Registry
uses: docker/login-action@v2
with:
registry: ccr.ccs.tencentyun.com
username: ${{ secrets.TCR_USERNAME }}
password: ${{ secrets.TCR_TOKEN }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')"
- name: Build && Push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
matrixorigin/matrixorigin.io.cn:${{ steps.date.outputs.date }}
ccr.ccs.tencentyun.com/mo-fronted/matrixorigin.io.cn:${{ steps.date.outputs.date }}