Skip to content

Commit

Permalink
chore: github action to build docker
Browse files Browse the repository at this point in the history
  • Loading branch information
filipton committed Jun 25, 2024
1 parent 79f80d5 commit 94dd817
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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

0 comments on commit 94dd817

Please sign in to comment.