Skip to content

Commit 917a5f8

Browse files
authored
Merge pull request #56 from Sailesh-Singh/main
Add nightly multi-platform Docker build and push to GitHub Container Registry
2 parents a762b80 + ab06322 commit 917a5f8

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Push Nightly docker image
1+
name: Build and Push Nightly Docker Image
22

33
on:
44
push:
@@ -19,20 +19,16 @@ jobs:
1919
env:
2020
REPOSITORY: '${{ github.repository }}'
2121

22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v2
24+
2225
- name: Log in to GitHub Container Registry
2326
run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
2427

25-
# Step 3: Sync Backend Image
26-
- name: Build, Tag, and Push Backend Image
28+
- name: Build, Tag, and Push Backend Image (Multi-Platform)
2729
run: |
28-
# Build the production image and tag it correctly
29-
docker build --target production -t ghcr.io/$REPOSITORY_LC/gnome-nepal-backend:nightly .
30-
docker push ghcr.io/$REPOSITORY_LC/gnome-nepal-backend:nightly
31-
32-
33-
# # Step 4: Sync Worker Image
34-
# - name: Build, Tag, and Push Worker Image
35-
# run: |
36-
# # Build the worker image and tag it correctly
37-
# docker build --target worker -t ghcr.io/$REPOSITORY_LC/gnome-nepal-worker-beat:nightly .
38-
# docker push ghcr.io/$REPOSITORY_LC/gnome-nepal-worker-beat:nightly
30+
docker buildx build \
31+
--platform linux/amd64,linux/arm64 \
32+
--target production \
33+
-t ghcr.io/$REPOSITORY_LC/gnome-nepal-backend:nightly \
34+
--push .

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
FROM python:3.11-slim AS base
1+
# Specify the platform as an argument
2+
ARG PLATFORM=linux/arm64
3+
4+
# Base image with specified platform
5+
FROM --platform=$PLATFORM python:3.11-slim AS base
26

37

48
# Create a non-root user and group

0 commit comments

Comments
 (0)