Repository navigation
59 lines (50 loc) · 1.6 KB
/
Copy pathdeploy-dev.yml
File metadata and controls
59 lines (50 loc) · 1.6 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
name: Deploy Dev
# main 푸시 → 이미지 빌드/푸시(GHCR) → Coolify dev 재배포
on:
push:
branches: [main]
concurrency:
group: deploy-dev
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
# dev 리소스는 :dev(이동 태그)에 고정. dev-<sha>는 추적/롤백용
tags: |
type=raw,value=dev
type=sha,prefix=dev-,format=short
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy to Coolify
run: |
curl --fail-with-body --request POST \
--connect-timeout 10 --max-time 60 \
"${{ secrets.COOLIFY_URL }}/api/v1/deploy?uuid=${{ secrets.COOLIFY_DEV_UUID }}&force=true" \
--header "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \
--header "Content-Length: 0"