This repository has been archived by the owner on Feb 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
71 lines (65 loc) · 2.17 KB
/
ci.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
name: ci
on:
push:
branches:
- 'master'
jobs:
docker:
runs-on: ubuntu-latest
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.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: openv2x/centerview:latest
build-args: |
GIT_BRANCH=${{ github.ref_name }}
REPO_URL=https://github.com/open-v2x/centerview
GIT_COMMIT=${{ github.sha }}
acr:
needs: docker
runs-on: ubuntu-latest
steps:
- name: sync image to ACR
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.FQ_HOST }}
username: ${{ secrets.FQ_USERNAME }}
key: ${{ secrets.FQ_KEY }}
port: ${{ secrets.FQ_PORT }}
script: |
set -e
(docker images | grep none | awk '{print $3}' | xargs -I{} docker rmi -f {}) || true
docker pull openv2x/centerview:latest
docker tag openv2x/centerview:latest registry.cn-shanghai.aliyuncs.com/openv2x/centerview:latest
docker push registry.cn-shanghai.aliyuncs.com/openv2x/centerview:latest
ssh:
needs: acr
runs-on: ubuntu-latest
steps:
- name: apply to all-in-one environment
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.AIO_MASTER_HOST }}
username: ${{ secrets.AIO_MASTER_USERNAME }}
key: ${{ secrets.AIO_MASTER_KEY }}
port: ${{ secrets.AIO_MASTER_PORT }}
script: |
set -e
rm -rf openv2x-aio-master.tar.gz && wget https://openv2x.oss-ap-southeast-1.aliyuncs.com/deploy/master/openv2x-aio-master.tar.gz
rm -rf src && tar zxvf openv2x-aio-master.tar.gz
cd src
sh install.sh