From 35c2516233214cc9f6ad94e92c8e158bd430dbef Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 14 Aug 2021 23:34:45 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20Working=20action=20for=20pushing?= =?UTF-8?q?=20to=20Docker=20to=20GHCR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-publish.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index af04d2fc..bfd01e77 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -16,12 +16,16 @@ jobs: contents: read packages: write steps: + # Fetch the code - name: Checkout repository uses: actions/checkout@v2 + # Build the image from default Dockerfile - name: Build image run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" + # Login into GH container registry - name: Log in to registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + # Push build image - name: Push image run: | IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME