-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (64 loc) · 1.96 KB
/
release-demo.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
name: Demo Release
on:
workflow_dispatch:
inputs:
tags:
description: "Version tags"
# push:
# branches: [main]
env:
VERSION: 0.9.0
jobs:
demo-release:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
token: ${{ secrets.TOKEN }}
- name: Copy source for distribution
run: |
cp -r . ../dist
rm -rf ../dist/.git
- name: Copy source to development
run: |
cp -r ../dist ./docker/development/app
cp ./online-demo.env ./docker/development/app/.env
- name: Get Version
run: |
echo VERSION=$(cat ./app.yao |grep 'version' | awk -F '"' '{print $4}') >> $GITHUB_ENV
- name: Check Version
run: echo $VERSION
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: hub.iqka.com
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build Development
uses: docker/build-push-action@v5
with:
context: ./docker/development
platforms: linux/amd64
push: true
tags: hub.iqka.com/max/yaoweb:${{ env.VERSION }}-amd64-dev
# https://yaoweb.iqka.com
- name: Deploy Development
uses: appleboy/[email protected]
with:
host: 139.199.30.36
port: 22
username: root
command_timeout: 30m
key: ${{ secrets.SSH_KEY }}
script: |
/data/docker/bin/deploy.sh max yaoweb ${{ env.VERSION }}-amd64-dev hub.iqka.com
docker exec yaoweb sh -c 'yao migrate --reset --force'
docker exec yaoweb sh -c 'yao run scripts.test.Data'