Skip to content

Merge pull request #89 from traP-jp/develop #29

Merge pull request #89 from traP-jp/develop

Merge pull request #89 from traP-jp/develop #29

Workflow file for this run

name: Build Docker Images
on:
workflow_dispatch:
push:
branches:
- main
tags:
- v*
jobs:
build-client:
name: Build Client Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
CAN_PUSH: ${{ github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate Image Tags
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}-client
- name: Login to GitHub Container Registry
if: env.CAN_PUSH
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./client
push: ${{ env.CAN_PUSH }}
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-server:
name: Build Server Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
CAN_PUSH: ${{ github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate Image Tags
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}-server
- name: Login to GitHub Container Registry
if: env.CAN_PUSH
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./server
push: ${{ env.CAN_PUSH }}
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max