generated from Game-as-a-Service/Gaas-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (77 loc) · 1.81 KB
/
main.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
name: Main
on:
push:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
subdir: [backend, frontend]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install package
run: |
cd ${{ matrix.subdir }}
yarn
- name: Run lint
run: |
cd ${{ matrix.subdir }}
yarn lint-check
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
subdir: [backend, frontend]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install package
run: |
cd ${{ matrix.subdir }}
yarn
- name: Run test
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
cd ${{ matrix.subdir }}
yarn test
build:
needs: [lint, test]
permissions:
contents: read
packages: write
id-token: write
strategy:
fail-fast: false
matrix:
subdir: [backend, frontend, nginx]
uses: allyusd/workflows/.github/workflows/docker-publish.yml@main
with:
subdir: ${{ matrix.subdir }}
deploy:
needs: build
runs-on: ubuntu-latest
environment: production
steps:
- name: Webhook
run: |
curl -s -X POST \
--fail \
-F token=${{ secrets.WEBHOOK_TOKEN }} \
-F ref=main \
${{ secrets.WEBHOOK_URL }} \
> /dev/null
# deploy:
# needs: build
# uses: allyusd/workflows/.github/workflows/docker-compose.yml@main
# with:
# namespace: game-as-a-service
# projectName: minesweeper
# secrets:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}