Skip to content

Commit

Permalink
GitHub action to build and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Lackronik committed Apr 14, 2024
1 parent 73406fc commit 75fdccf
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build_img.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build ARM image and Publish to ECR

on:
push:
branches:
- develop

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ github.sha }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.login-ecr.outputs.registry }}/castledice-storage_backend:latest
platforms: linux/amd64,linux/arm64
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG IMAGE_VERSION=python:3.10.13-alpine
ARG PLATFORM
ARG IMAGE_VERSION=python:3.11.2-alpine
ARG PLATFORM=linux/arm64

###########
# BUILDER #
Expand All @@ -25,7 +25,6 @@ RUN set -ex \
&& apk update \
&& apk add --no-cache --virtual .build-deps postgresql-dev gcc python3-dev \
musl-dev zlib-dev jpeg-dev build-base libwebp-dev linux-headers curl-dev curl \
&& curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh \
&& pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt

Expand Down

0 comments on commit 75fdccf

Please sign in to comment.