From 394fdf0736a3e6e12191f48c2269224151053f65 Mon Sep 17 00:00:00 2001 From: Louis_45 Date: Wed, 8 May 2024 18:24:55 +0200 Subject: [PATCH] Added workflows for docker and github --- .github/workflows/docker-build-latest.yml | 52 ++++++++++++++++++++++ .github/workflows/docker-build-version.yml | 46 +++++++++++++++++++ DockerHub-README.md | 2 + 3 files changed, 100 insertions(+) create mode 100644 .github/workflows/docker-build-latest.yml create mode 100644 .github/workflows/docker-build-version.yml create mode 100644 DockerHub-README.md diff --git a/.github/workflows/docker-build-latest.yml b/.github/workflows/docker-build-latest.yml new file mode 100644 index 0000000000..22cb509204 --- /dev/null +++ b/.github/workflows/docker-build-latest.yml @@ -0,0 +1,52 @@ +name: Docker Image - Latest + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: luois45 + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: Luois45 + password: ${{ secrets.GIT_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: | + luois45/claim-free-steam-packages:latest + ghcr.io/luois45/claim-free-steam-packages:latest + platforms: linux/amd64, linux/arm64/v8, linux/arm/v7 + + - name: Update Hub Description + uses: peter-evans/dockerhub-description@v2 + with: + username: luois45 + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: luois45/claim-free-steam-packages + readme-filepath: ./DockerHub-README.md diff --git a/.github/workflows/docker-build-version.yml b/.github/workflows/docker-build-version.yml new file mode 100644 index 0000000000..5aaa2aec9a --- /dev/null +++ b/.github/workflows/docker-build-version.yml @@ -0,0 +1,46 @@ +name: Docker Image - Version + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: luois45 + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: Luois45 + password: ${{ secrets.GIT_TOKEN }} + + - name: Extract Version Tag + id: extract_tag + run: echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: | + luois45/claim-free-steam-packages:${{ env.VERSION_TAG }} + ghcr.io/luois45/claim-free-steam-packages:${{ env.VERSION_TAG }} + platforms: linux/amd64, linux/arm64/v8, linux/arm/v7 diff --git a/DockerHub-README.md b/DockerHub-README.md new file mode 100644 index 0000000000..f0aef074bb --- /dev/null +++ b/DockerHub-README.md @@ -0,0 +1,2 @@ +Software for the automated activation of free Steam packages (games, movies, DLC, etc.) +Please have a look of it on my [GitHub](https://github.com/Luois45/claim-free-steam-packages).