ci(docker): auto publish to Docker Hub

This commit is contained in:
MingxuanGame
2025-08-28 15:05:59 +00:00
parent bc2f481323
commit e35e7ee0ef
4 changed files with 116 additions and 2 deletions

View File

@@ -0,0 +1,57 @@
name: Build and Push Docker Image (osu!RX)
on:
push:
branches: [ main ]
paths-ignore:
- '*.md'
- '**/*.md'
- 'docs/**'
env:
IMAGE_NAME: mingxuangame/g0v0-server
jobs:
build-and-push-osurx:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=osurx
type=sha,prefix=osurx-
- name: Build and push Docker image (osu!RX)
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile-osurx
platforms: linux/amd64, linux/arm64
push: true
tags: |
${{ env.IMAGE_NAME }}:osurx
${{ env.IMAGE_NAME }}:osurx-${{ github.sha }}
cache-from: type=gha,scope=osurx
cache-to: type=gha,mode=max,scope=osurx