-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (85 loc) · 2.75 KB
/
deploy.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
77
78
79
80
81
82
83
84
85
86
87
88
name: deploy
on:
push:
branches:
- main
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
image: [server, client, worker]
steps:
-
name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
#
# SERVER
#
-
name: Build and push server
uses: docker/build-push-action@v2
if: ${{ matrix.image == 'server' }}
with:
tags: ${{ format('ghcr.io/microbiomedata/nmdc-server/server:{0}', github.event.release.tag_name || 'latest') }}
push: true
-
name: Deploy server
uses: fjogeleit/[email protected]
if: ${{ matrix.image == 'server' && github.event_name == 'push' }}
with:
url: 'https://rancher2.spin.nersc.gov/v3/project/c-tmq7p:p-bkv45/workloads/deployment:nmdc-dev:portal-backend?action=redeploy'
method: 'POST'
username: ${{ secrets.SPIN_USER }}
password: ${{ secrets.SPIN_PASSWORD }}
#
# CLIENT
#
-
name: Build and push client
uses: docker/build-push-action@v2
if: ${{ matrix.image == 'client' }}
with:
tags: ${{ format('ghcr.io/microbiomedata/nmdc-server/client:{0}', github.event.release.tag_name || 'latest') }}
context: web
push: true
-
name: Deploy client
uses: fjogeleit/[email protected]
if: ${{ matrix.image == 'client' && github.event_name == 'push' }}
with:
url: 'https://rancher2.spin.nersc.gov/v3/project/c-tmq7p:p-bkv45/workloads/deployment:nmdc-dev:portal-frontend?action=redeploy'
method: 'POST'
username: ${{ secrets.SPIN_USER }}
password: ${{ secrets.SPIN_PASSWORD }}
#
# WORKER
#
-
name: Build and push worker
uses: docker/build-push-action@v2
if: ${{ matrix.image == 'worker' }}
with:
tags: ${{ format('ghcr.io/microbiomedata/nmdc-server/worker:{0}', github.event.release.tag_name || 'latest') }}
file: ./Dockerfile.worker
push: true
-
name: Deploy worker
uses: fjogeleit/[email protected]
if: ${{ matrix.image == 'worker' && github.event_name == 'push' }}
with:
url: 'https://rancher2.spin.nersc.gov/v3/project/c-tmq7p:p-bkv45/workloads/deployment:nmdc-dev:portal-worker?action=redeploy'
method: 'POST'
username: ${{ secrets.SPIN_USER }}
password: ${{ secrets.SPIN_PASSWORD }}