From 7103b5d573090602ddfa2b647c569e79617e2025 Mon Sep 17 00:00:00 2001 From: Vasil Boyadzhiev Date: Tue, 11 Jun 2024 23:06:30 +0300 Subject: [PATCH] Update docker-image.yml Added push to GitHub Container repositoriy. --- .github/workflows/docker-image.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 37b5ff1e8236..bcb60d57a6de 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,4 +1,4 @@ -name: Build Docker image for project +name: Build & Push Docker image for project on: push: @@ -8,12 +8,20 @@ on: jobs: - build: + build-and-push: runs-on: ubuntu-latest if: ${{ (github.event_name == 'pull_request' && github.event.label.name == 'CI:Build') }} - steps: + steps: - uses: actions/checkout@v4 + - name: Login to Github Container repository + - uses: docker/login-action@v3.2.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build the Docker image run: docker build . --file Dockerfile --tag go-etherium-devops:$(date +%s) + - name: Push Docker image to Github container repository + run: docker push ghcr.io/go-etherium-devops:$(date +%s)