Skip to content

docs: useful readme #16

docs: useful readme

docs: useful readme #16

name: Publish docker image
on:
push:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME_SERVER: fkmtime/fkmtime-proxy-server
IMAGE_NAME_CLIENT: fkmtime/fkmtime-proxied-nginx
jobs:
push:
name: Push to ghcr.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_SERVER }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: ./
file: Dockerfile
target: proxy-server
push: true
platforms: linux/amd64, linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Extract Docker metadata 2
id: meta2
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_CLIENT }}
- name: Build and push Docker image 2
id: build-and-push2
uses: docker/build-push-action@v6
with:
context: ./
file: Dockerfile
target: proxy-client
push: true
platforms: linux/amd64, linux/arm64
tags: ${{ steps.meta2.outputs.tags }}
labels: ${{ steps.meta2.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max