From e50395b8abdc958713879b6d89d0d418c0ef087d Mon Sep 17 00:00:00 2001 From: phyzical <5182053+phyzical@users.noreply.github.com> Date: Sat, 27 Jul 2024 17:41:33 +0800 Subject: [PATCH] change to publish to github --- .github/workflows/docker-image.yml | 36 +++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 90879bab..4c0d546b 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,18 +1,28 @@ -name: Docker Image CI - +name: build and publish on: push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - + branches: [master] + workflow_dispatch: + permissions: + content: read + packages: write jobs: - - build: - + docker: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag cs2-modded-server:$(date +%s) + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + tags: ghcr.io/${{ github.repository }}:latest + platforms: linux/amd64,linux/arm64