Skip to content

Commit

Permalink
Publish docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
mjarkk committed Apr 24, 2024
1 parent fa4dbd0 commit 4254c56
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: publish

on:
push:
tags:
- '*'

jobs:
publish:
permissions:
packages: write

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1

- name: Setup mirror
uses: self-actuated/hub-mirror@master
- name: Get TAG
id: get_tag
run: echo TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
- name: Get Repo Owner
id: get_repo_owner
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to container Registry
uses: docker/login-action@v2
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- name: Release build
id: release_build
uses: docker/build-push-action@v4
with:
outputs: "type=registry,push=true"
provenance: false
platforms: linux/amd64,linux/arm/v6,linux/arm64
tags: |
ghcr.io/${{ env.REPO_OWNER }}/whatsapp-dev:${{ github.sha }}
ghcr.io/${{ env.REPO_OWNER }}/whatsapp-dev:${{ env.TAG }}
ghcr.io/${{ env.REPO_OWNER }}/whatsapp-dev:latest
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH

# Build the frontend container
FROM node:21-slim AS frontend
FROM --platform=linux/amd64 node:21-slim AS frontend

COPY . /app
WORKDIR /app

RUN npm i && npm run build

# Build the runtime container
FROM golang:1.21
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.21

WORKDIR /usr/src/app

Expand Down

0 comments on commit 4254c56

Please sign in to comment.