Skip to content

Commit

Permalink
Add github action workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Daishan Peng <[email protected]>
  • Loading branch information
StrongMonkey committed Aug 1, 2024
1 parent 8ea7c0e commit 046d837
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and Push Docker Images

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [linux/amd64, linux/arm64, darwin/amd64, darwin/arm64]

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

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

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

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

- name: Build and push server Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
platforms: ${{ matrix.platform }}
push: true
tags: |
ghcr.io/${{ github.repository }}/server:${{ github.ref_name }}
ghcr.io/${{ github.repository }}/server:latest
- name: Build and push UI Docker image
uses: docker/build-push-action@v3
with:
context: ./ui
file: ./ui/Dockerfile
platforms: ${{ matrix.platform }}
push: true
tags: |
ghcr.io/${{ github.repository }}/ui:${{ github.ref_name }}
ghcr.io/${{ github.repository }}/ui:latest

0 comments on commit 046d837

Please sign in to comment.