Skip to content

Commit 892f05c

Browse files
Update ci.yml
1 parent dff7f41 commit 892f05c

File tree

1 file changed

+22
-31
lines changed

1 file changed

+22
-31
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,43 @@
1-
# .github/workflows/ci.yml
2-
name: CI / Docker Build
1+
name: Build & Publish Docker Image
32

43
on:
54
push:
65
branches: [ main ]
76
pull_request:
87
branches: [ main ]
98

9+
permissions:
10+
contents: read
11+
packages: write
12+
1013
jobs:
11-
build:
14+
build-and-push:
1215
runs-on: ubuntu-latest
13-
env:
14-
MODE: local
15-
FFMPEG_PATH: /usr/bin/ffmpeg
16-
FFPROBE_PATH: /usr/bin/ffprobe
17-
VMAF_PATH: /usr/bin/true # no-op in CI
1816

1917
steps:
20-
- name: Checkout repository
18+
- name: Checkout code
2119
uses: actions/checkout@v4
2220

23-
- name: Set up Python 3.10
24-
uses: actions/setup-python@v4
25-
with:
26-
python-version: '3.10'
27-
28-
- name: Install system FFmpeg
29-
run: |
30-
sudo apt-get update
31-
sudo apt-get install -y ffmpeg
32-
33-
- name: Install Python dependencies
34-
run: |
35-
python -m pip install --upgrade pip
36-
pip install --no-cache-dir -r requirements.txt
21+
- name: Set up QEMU (for multi‑arch)
22+
uses: docker/setup-qemu-action@v2
3723

38-
- name: Set PYTHONPATH for imports
39-
run: echo "PYTHONPATH=${{ github.workspace }}" >> $GITHUB_ENV
40-
41-
- name: Build multi-arch Docker image (no load)
24+
- name: Set up Docker Buildx
4225
uses: docker/setup-buildx-action@v3
4326

44-
- name: Build Docker image
27+
- name: Log in to GitHub Container Registry
28+
uses: docker/login-action@v2
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Build and push multi-arch image
4535
uses: docker/build-push-action@v4
4636
with:
4737
context: .
4838
file: Dockerfile
4939
platforms: linux/amd64,linux/arm64
50-
push: false
51-
load: false
52-
tags: ffmpeg-api-service:latest
40+
push: true
41+
tags: |
42+
ghcr.io/${{ github.repository_owner }}/ffmpeg-api-service:latest
43+
ghcr.io/${{ github.repository_owner }}/ffmpeg-api-service:${{ github.sha }}

0 commit comments

Comments
 (0)