From ab8434694579ee759876fb6c628decca599a416f Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 20 Oct 2022 22:01:27 +0200 Subject: [PATCH] GitHub Action to build & push Docker image --- .github/workflows/docker.yml | 48 ++++++++++++++++++++++++++++++++++++ docker-compose.yml | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..5d44b87 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,48 @@ +name: Build and push Docker image (amd64, arm64 to hub.docker.com and ghcr.io) + +on: + workflow_dispatch: + push: + branches: + - 'main' + paths-ignore: + - ".github/**" + - ".gitignore" + - "README.md" + +jobs: + docker: + runs-on: ubuntu-latest + steps: + # - + # name: Checkout + # uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: | + voglerr/free-games-claimer:latest + ghcr.io/vogler/free-games-claimer:latest diff --git a/docker-compose.yml b/docker-compose.yml index 154cb57..e62360e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: free-games-claimer: container_name: fgc # is printed in front of every output line - image: free-games-claimer # otherwise image name will be free-games-claimer-free-games-claimer + image: ghcr.io/vogler/free-games-claimer # otherwise image name will be free-games-claimer-free-games-claimer build: . ports: - '5900:5900'