Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Multiplatform docker build #70

Merged
merged 11 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Publish Docker image
on:
release:
types: [published]
push:
branches:
- docker

jobs:
push_to_registries:
Expand All @@ -15,32 +18,37 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

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

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: |
yetiplatform/yeti-frontend
ghcr.io/${{ github.repository }}/yeti-frontend
ghcr.io/${{ github.repository }}

- name: Build and push Docker images
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/prod/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }},yetiplatform/yeti-frontend:latest,ghcr.io/${{ github.repository }}:latest
labels: ${{ steps.meta.outputs.labels }}
3 changes: 1 addition & 2 deletions docker/prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Container used to build the minified frontend JS code
FROM node:buster AS frontend-builder
FROM amd64/node:buster AS frontend-builder

RUN apt update && apt install python3
RUN npm install -g n && n 16

ADD . /app
Expand Down