Repository navigation
83 lines (66 loc) · 2.32 KB
/
Copy pathdeploy.yml
File metadata and controls
83 lines (66 loc) · 2.32 KB
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: Deployment
on:
push:
branches: [ "master", "next" ]
jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Use Node.js 24.18.0
uses: actions/setup-node@v5
with:
node-version: 24.18.0
- name: Type Check
run: |
npm install --include=dev
npm run check
build:
needs: typecheck
if: success()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Use Node.js 24.18.0
uses: actions/setup-node@v5
with:
node-version: 24.18.0
- name: Run Build
run: |
npm install --include=dev
npm run build
# Log in to the GitHub Container Registry (GHCR)
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
if: ${{ github.ref_name == 'master' }}
run: |
docker build -t ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest .
- name: Build Docker image
if: ${{ github.ref_name == 'next' }}
run: |
docker build -t ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:next .
# Push the Docker image to GitHub Container Registry
- name: Push Docker image to GHCR
if: ${{ github.ref_name == 'master' }}
run: |
docker push ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
# Tell Portainer to pull the new image and redeploy the stack
- name: Trigger Portainer redeploy (production)
if: ${{ github.ref_name == 'master' }}
run: |
curl -fsSL -X POST "https://swarm.topstats.gg/api/webhooks/c9a9706c-6729-4964-83f5-79e0770be15c"
# Push the Docker image to GitHub Container Registry
- name: Push Docker image to GHCR
if: ${{ github.ref_name == 'next' }}
run: |
docker push ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:next
# Tell Portainer to pull the new image and redeploy the stack
- name: Trigger Portainer redeploy (next)
if: ${{ github.ref_name == 'next' }}
run: |
curl -fsSL -X POST "https://swarm.topstats.gg/api/webhooks/c382aa91-b4c7-46d1-b549-3b97dfc89a83"