Skip to content

Commit 6fd8247

Browse files
committed
feat: add release automation
1 parent 62cc9a8 commit 6fd8247

File tree

5 files changed

+112
-5
lines changed

5 files changed

+112
-5
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [dev, main]
6+
7+
jobs:
8+
ci:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
cache: "npm"
17+
18+
- run: npm ci
19+
20+
- run: npx prisma generate
21+
22+
- run: npm run lint
23+
24+
- run: npm test
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Docker Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
jobs:
17+
build-and-push:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v3
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Log in to GHCR
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ${{ env.REGISTRY }}
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Extract metadata (tags, labels)
37+
id: meta
38+
uses: docker/metadata-action@v5
39+
with:
40+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41+
tags: |
42+
type=semver,pattern={{version}}
43+
type=semver,pattern={{major}}.{{minor}}
44+
type=semver,pattern={{major}}
45+
type=raw,value=latest
46+
47+
- name: Build and push
48+
uses: docker/build-push-action@v6
49+
with:
50+
context: .
51+
platforms: linux/amd64,linux/arm64
52+
push: false
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+
cache-from: type=gha
56+
cache-to: type=gha,mode=max
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
release_created: ${{ steps.release.outputs.release_created }}
17+
tag_name: ${{ steps.release.outputs.tag_name }}
18+
steps:
19+
- uses: googleapis/release-please-action@v4
20+
id: release
21+
with:
22+
release-type: node

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ dev.db-journal
4747
data/files/resumes
4848
CLAUDE.md
4949
/docs
50-
.github
50+
.github/*
51+
!.github/workflows
5152
.claude
5253
.specify
5354
/specs

docker-compose.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
services:
22
app:
3+
image: ghcr.io/gsync/jobsync:latest
34
container_name: jobsync_app
4-
build:
5-
context: .
6-
dockerfile: Dockerfile
75
ports:
86
- "3737:3000"
97
environment:
108
- NODE_ENV=production
119
- DATABASE_URL=file:/data/dev.db
1210
- AUTH_SECRET=${AUTH_SECRET:-}
13-
- ENCRYPTION_KEY=you-encryption-key-here
11+
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-you-encryption-key-here}
1412
- NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3737}
1513
- AUTH_TRUST_HOST=${AUTH_TRUST_HOST:-true}
1614
- TZ=${TZ:-America/Edmonton}
@@ -21,3 +19,9 @@ services:
2119
volumes:
2220
- ./jobsyncdb/data:/data
2321
restart: unless-stopped
22+
healthcheck:
23+
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3737"]
24+
interval: 30s
25+
timeout: 10s
26+
retries: 3
27+
start_period: 30s

0 commit comments

Comments
 (0)