-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (78 loc) · 2.73 KB
/
build-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
name: build-deploy
on:
workflow_dispatch:
push:
branches:
- develop
- master
- release/*
- feature/happyship-wisp
tags:
- v[0-9]+.[0-9]+.[0-9]+*
jobs:
build-app:
runs-on: self-hosted # ubuntu-latest
steps:
- id: build
uses: momentum-xyz/docker-build-action@4a172ff54dac4e9beae2a1ca8584f22d26c3c3aa # v6.3.6
with:
registry-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
registry-user: ${{ secrets.REGISTRY_USERNAME }}
registry-pass: ${{ secrets.REGISTRY_PASSWORD }}
github-token: ${{ secrets.GITHUB_TOKEN }}
npm-token: ${{ secrets.GITHUB_TOKEN }}
outputs:
version: ${{ steps.build.outputs.version }}
dev2-deploy:
runs-on: self-hosted
needs: build-app
if: github.ref == 'refs/heads/develop'
concurrency: dev-deploy-${{ github.ref }}
steps:
- id: deploy-dev
uses: momentum-xyz/deploy-action@d339ad4b15e98dfed06f84b49a654b43ca9a3d8a # v1.2.0
with:
version: ${{ env.VERSION }}
k8s-credentials: ${{ secrets[secrets.REF_K8S_DEV2] }}
build-plugins:
runs-on: self-hosted
needs: build-app
strategy:
matrix:
plugin: ["miro", "gdrive", "video"]
include:
- plugin: gdrive
directory: google_drive
deploy: google-drive
steps:
- name: "Checkout"
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- id: build-plugin
name: Build plugin
uses: ./.github/actions/build-plugin
with:
plugin-name: ${{ matrix.plugin }}
version: ${{ needs.build-app.outputs.version }}
registry-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
registry-user: ${{ secrets.REGISTRY_USERNAME }}
registry-pass: ${{ secrets.REGISTRY_PASSWORD }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k8s-credentials: ${{ secrets[secrets.REF_K8S_DEV2] }}
plugin-dir: ${{ matrix.directory }}
deploy-name: ${{ matrix.deploy }}
ops-deploy:
runs-on: ubuntu-latest
needs: [build-app, build-plugins]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
PROJECT_NAME: ${{ github.event.repository.name }}
VERSION: ${{ needs.build-app.outputs.version }}
steps:
- id: deploy-ops
name: Dispatch to Operations
uses: peter-evans/repository-dispatch@26b39ed245ab8f31526069329e112ab2fb224588 # v2.1.1
with:
token: ${{ secrets.ODYSSEY_OPERATIONS }}
repository: momentum-xyz/Operations
event-type: make-acc-pr
client-payload: '{"name": "${{ env.PROJECT_NAME }}", "version": "${{ env.VERSION }}", "actor": "${{ github.event.actor.login }}"}'