From 62afcdca54c9cfdd65f736a917b2da4b25554e86 Mon Sep 17 00:00:00 2001 From: Antoine Rybacki <15911822+Lifeismana@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:59:28 +0200 Subject: [PATCH] build it via github action --- .github/workflows/build.yml | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ccc10ec --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,65 @@ +name: Build Docker image APK Watcher + +on: + schedule: + - cron: '0 5 * * 1' + push: + branches: [ "main" ] + # Publish semver tags as releases. + paths: + - 'scripts.sh' + - 'Dockerfile' + +concurrency: + group: ${{ github.workflow }} + +env: + TITLE: Steam APK Watcher + # github.repository as / + GHCR_SLUG: ghcr.io/steam-tracking/steam-apk-watcher + +jobs: + build: + runs-on: ubuntu-latest + permissions: + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.GHCR_SLUG }} + labels: | + maintainer=${{ github.repository_owner }} + org.opencontainers.image.vendor=${{ github.repository_owner }} + org.opencontainers.image.title=${{ env.TITLE }} + + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v3.3.0 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3.1.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v5.3.0 + with: + #context: "{{defaultContext}}:Docker" + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ env.GHCR_SLUG }}:latest + cache-from: ${{ env.GHCR_SLUG }}:latest + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file