-
Notifications
You must be signed in to change notification settings - Fork 19
64 lines (59 loc) · 1.66 KB
/
Copy pathbuild.yml
File metadata and controls
64 lines (59 loc) · 1.66 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
name: build-and-push
on:
push:
branches: [svelte-kit]
workflow_dispatch: {}
permissions:
contents: read
packages: write
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: sticker-api
file: docker/go.Dockerfile
args: CMD=api
- name: sticker-migrate
file: docker/go.Dockerfile
args: CMD=migrate
- name: sticker-web
file: docker/nuxt.Dockerfile
args: ''
steps:
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v7
with:
context: .
file: ${{ matrix.file }}
build-args: ${{ matrix.args }}
push: true
tags: |
ghcr.io/kunmoe/${{ matrix.name }}:latest
ghcr.io/kunmoe/${{ matrix.name }}:${{ github.sha }}
cache-from: type=gha,scope=${{ matrix.name }}
cache-to: type=gha,mode=max,scope=${{ matrix.name }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Trigger Dokploy redeploy
env:
WEBHOOK: ${{ secrets.DOKPLOY_WEBHOOK_STICKER }}
run: |
if [ -z "$WEBHOOK" ]; then
echo "DOKPLOY_WEBHOOK_STICKER not set — images pushed to GHCR, skipping redeploy trigger."
exit 0
fi
curl -fsS -X POST "$WEBHOOK"