This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
80 lines (68 loc) · 2.17 KB
/
deploy-lts-modules.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
name: build go-simp lts module
on:
workflow_dispatch:
inputs:
versionTag:
description: 'new version of this build'
required: true
default: 'latest'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
## Build main image
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: justhumanz/go-simp:${{ github.sha }}
### Pilot
- name: Build and push go-simp-pilot
uses: docker/build-push-action@v2
with:
context: ./service/pilot
push: true
tags: justhumanz/go-simp-pilot:${{ github.event.inputs.versionTag }}
build-args: |
BASE_IMAGE=justhumanz/go-simp:${{ github.sha }}
### Utility
- name: Build and push go-simp-utility
uses: docker/build-push-action@v2
with:
context: ./service/utility
push: true
tags: justhumanz/go-simp-utility:${{ github.event.inputs.versionTag }}
build-args: |
BASE_IMAGE=justhumanz/go-simp:${{ github.sha }}
deploy:
needs: build
environment:
name: production
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: SSH and deploy to server
uses: fifsky/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
user: ${{ secrets.USER }}
key: ${{ secrets.SSH_KEY }}
command: |
export RELEASE_VERSION=${{ github.event.inputs.versionTag }}
export TOPGG=${{ env.TOPGG }}
cd Go-Simp/swarm
sudo git pull
docker stack deploy -c main.yaml engine --with-registry-auth