-
Notifications
You must be signed in to change notification settings - Fork 57
61 lines (56 loc) · 2.64 KB
/
devnet_teleport.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
### THIS WORKFLOW IS USED FOR SERVER RUNNING TELEPORT ONLY
### DONOT RUN THIS WORKFLOW FOR MAINNET PRODUCTION
name: Devnet Teleport
on: workflow_dispatch
jobs:
devnet:
permissions:
# The "id-token: write" permission is required or Machine ID will not be able to authenticate with the cluster.
id-token: write
contents: read
# The name of the workflow, and the Linux distro to be used to perform the required steps.
name: Devnet_Teleport
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '10.6'
- name: Install package
run: |
mkdir build && mkdir build/contracts && cp abis/*json build/contracts && npm ci --no-audit
- name: Build
run: npm run build
- name: Fetch Teleport binaries
uses: teleport-actions/setup@v1
with:
version: 13.3.8
- name: Fetch credentials using Machine ID
id: auth
uses: teleport-actions/auth@v1
with:
# Use the address of the auth/proxy server for your own cluster.
proxy: ${{ secrets.TELEPORT_PROXY }}
# Use the name of the join token resource you created in step 1.
token: github-action-tomo
# Specify the length of time that the generated credentials should be
# valid for. This is optional and defaults to "1h"
certificate-ttl: 1h
# Enable the submission of anonymous usage telemetry.
anonymous-telemetry: 1
- name: Deploy to devnet
run: |
tsh -i ${{ steps.auth.outputs.identity-file }} ssh ${{ secrets.TELEPORT_USERNAME_DEVNET }}@${{ secrets.TELEPORT_HOSTNAME_DEVNET }} "rm -rf ${{ secrets.DEVNET_DEPLOY_PATH }} && mkdir ${{ secrets.DEVNET_DEPLOY_PATH }}"
rsync -r -e 'tsh ssh -i ${{ steps.auth.outputs.identity-file }}' ./ ${{ secrets.TELEPORT_USERNAME_DEVNET }}@${{ secrets.TELEPORT_HOSTNAME_DEVNET }}:${{ secrets.DEVNET_DEPLOY_PATH }}
tsh -i ${{ steps.auth.outputs.identity-file }} ssh ${{ secrets.TELEPORT_USERNAME_DEVNET }}@${{ secrets.TELEPORT_HOSTNAME_DEVNET }} "cd ${{ secrets.DEVNET_DEPLOY_PATH }} && bash deploy.sh"
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: system-healthcheck
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
SLACK_ICON_EMOJI: ':tomomaster:'
SLACK_MESSAGE: '[Devnet] TomoMaster has been deployed'
SLACK_USERNAME: tomomaster-deploy-bot
SLACK_WEBHOOK: ${{ secrets.SLACK }}