-
Notifications
You must be signed in to change notification settings - Fork 8
82 lines (69 loc) · 1.96 KB
/
deno.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
name: Deno
on:
push:
tags: ["v*"]
pull_request:
branches: ["main"]
workflow_dispatch:
inputs:
perform_deploy:
type: boolean
required: true
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v1.1.4
with:
deno-version: v1.x
- name: Verify formatting
run: deno fmt --check
- name: Run linter
run: deno lint
- name: Run type check
run: deno task check
- name: Run tests
run: deno test -A
deploy:
if: >-
vars.DEPLOY_ENABLED == 'true' &&
contains(fromJSON(vars.DEPLOYERS), github.actor) &&
(startsWith(github.ref, 'refs/tags/v') || inputs.perform_deploy)
runs-on: ubuntu-latest
needs: test
env:
WORK_DIR: harmony
steps:
- name: Setup repo
uses: actions/checkout@v4
with:
path: ${{ env.WORK_DIR }}
- name: Deploy
uses: easingthemes/ssh-deploy@v5.0.3
with:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }}
ARGS: "-cilrvz --delete"
SOURCE: ${{ env.WORK_DIR }}/
REMOTE_HOST: ${{ secrets.DEPLOY_HOST }}
REMOTE_PORT: ${{ secrets.DEPLOY_PORT || 22 }}
REMOTE_USER: ${{ secrets.DEPLOY_USER }}
TARGET: ${{ secrets.DEPLOY_TARGET }}
EXCLUDE: "/deno.lock, /.env, /snaps.db, /snaps/"
SCRIPT_BEFORE_REQUIRED: true
SCRIPT_BEFORE: |
set -e
ls -al "${{ secrets.DEPLOY_TARGET }}"
SCRIPT_AFTER_REQUIRED: true
SCRIPT_AFTER: |
set -e
ls -al "${{ secrets.DEPLOY_TARGET }}"
cd "${{ secrets.DEPLOY_TARGET }}"
deno task build
if [[ -n "${{ secrets.DEPLOY_SERVICE }}" ]]; then
systemctl --user restart "${{ secrets.DEPLOY_SERVICE }}"
fi