Skip to content

Commit

Permalink
Publish gateway, order, and stocks docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
kchiranjewee63 committed Jul 19, 2024
1 parent 0317bb9 commit 0752d92
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/gateway-image-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Gateway images

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
deployments: write

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- 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: gateway
file: ./gateway/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}/gateway:latest
41 changes: 41 additions & 0 deletions .github/workflows/order-image-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Order images

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
deployments: write

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- 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: order
file: ./order/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}/order:latest
41 changes: 41 additions & 0 deletions .github/workflows/stocks-image-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Stocks images

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
deployments: write

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- 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: stocks
file: ./stocks/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}/stocks:latest
2 changes: 1 addition & 1 deletion gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TODO: Use a multi-stage build process to reduce the final image size.
FROM golang:1.22.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.22.0 AS builder

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion order/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TODO: Use a multi-stage build process to reduce the final image size.
FROM golang:1.22.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.22.0 AS builder

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion stocks/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TODO: Use a multi-stage build process to reduce the final image size.
FROM golang:1.22.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.22.0 AS builder

WORKDIR /app

Expand Down

0 comments on commit 0752d92

Please sign in to comment.