-
Notifications
You must be signed in to change notification settings - Fork 9
69 lines (58 loc) · 1.78 KB
/
push-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
name: Build and deploy
permissions:
id-token: write # Require write permission to Fetch an OIDC token.
on:
push:
branches: [ master ]
# Allow manually triggering deployment
workflow_dispatch:
jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Set up cache for NPM modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm i --no-audit
- name: Compile to JavaScript
run: npm run build
env:
CI: true
- name: Prune dependencies
run: npm prune --production
- name: Deploy
uses: mojira/deploy@main
with:
azure_client_id: ${{ secrets.AZURE_CLIENT_ID }}
azure_tenant_id: ${{ secrets.AZURE_TENANT_ID }}
azure_subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
bastion_name: ${{ secrets.BASTION_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
resource_id: ${{ secrets.RESOURCE_ID }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
username: mojiradiscordbot
artifact_paths: |
bin
node_modules
config
*.sh
artifact_destination: /home/mojiradiscordbot/mojira-discord-bot
rsync_args: "-avhW --delete --exclude='local.yml' --exclude='local-*.yml'"
script: |
cd mojira-discord-bot
./restart.sh main