From 7b2a22b911de4e7a1cf97c504d8da3b47c99738f Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Mon, 16 Sep 2024 13:29:16 +0200 Subject: [PATCH] Docker login through action --- .github/workflows/main.yml | 9 +++++++-- README.md | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7858caf..35de4f5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,11 +16,16 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 with: push: ${{ github.event_name != 'pull_request' }} tags: ghcr.io/wyhrihaximusnet/docker-github-action-runner:latest platforms: linux/amd64,linux/arm64 - secrets: | - GIT_AUTH_TOKEN=${{ secrets.GHCR_TOKEN }} diff --git a/README.md b/README.md index b2ec38a..e24ae83 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # docker-github-action-runner + Opinionated GitHub Action Runner image