-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (71 loc) · 2.15 KB
/
Copy pathworker-image.yml
File metadata and controls
75 lines (71 loc) · 2.15 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
name: Publish Worker Image
on:
push:
branches:
- main
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
permissions:
contents: read
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.33.1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile=false
- name: Build worker image for smoke check
uses: docker/build-push-action@v6
with:
context: .
file: apps/worker/Dockerfile
load: true
push: false
tags: csvshape-worker:smoke
- name: Boot worker container
run: |
docker run -d --rm --name csvshape-worker-smoke -p 8797:8797 csvshape-worker:smoke
- name: Verify worker health
env:
CSVSHAPE_WORKER_HEALTH_OUT: docs/qc/benchmarks/worker-health-ci.json
run: node apps/worker/scripts/check-health.mjs
- name: Upload worker health artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: csvshape-worker-health
path: docs/qc/benchmarks/worker-health-ci.json
- name: Show worker logs on failure
if: failure()
run: docker logs csvshape-worker-smoke
- name: Stop worker container
if: always()
run: docker stop csvshape-worker-smoke || true
- id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/csvshape-worker
tags: |
type=ref,event=branch
type=sha,prefix=sha-
type=raw,value=latest,enable={{is_default_branch}}
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
file: apps/worker/Dockerfile
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}