-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.96 KB
/
build-and-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
name: Build and Deploy
on:
push:
branches:
- 'master'
tags:
- v*
pull_request:
jobs:
validate:
name: Validate Kubernetes configurations
runs-on: ubuntu-latest
steps:
- name: Checking out repo
uses: actions/checkout@v2
- name: Validate manifests
uses: instrumenta/kubeval-action@master
with:
files: etc
build:
name: Build and Audit
needs: validate
runs-on: ubuntu-latest
steps:
- name: Checking out repo
uses: actions/checkout@v2
- name: Installing dependencies
run: npm ci
- name: Build web components
run: npm run build:web
- name: Building bot
run: npm run build:bot
# Tests are not done on GitHub Actions to avoid polluting wiki CheckUser
# databases.
deploy:
name: Deploy to Toolforge
needs: build
if: github.ref_type == 'tag' || (
github.event.pusher.name == 'ChlodAlejandro'
&& startsWith(github.event.head_commit.message, '[force]'))
runs-on: ubuntu-latest
environment:
name: toolforge
url: https://zoomiebot.toolforge.org
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.TOOLFORGE_SSH_KEY }}
name: id_ed25519
known_hosts: ${{ secrets.TOOLFORGE_KNOWN_HOSTS }}
config: ${{ secrets.TOOLFORGE_CONFIG }}
- name: Pull latest commit
run: ssh dev.toolforge.org \
become zoomiebot \
bash /data/project/zoomiebot/project/scripts/update.sh