From 6b00c9beddc9d7fe5e0a5e6b05f1d21584a5f34a Mon Sep 17 00:00:00 2001 From: Vincent Berry <37981730+vincentberry@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:05:48 +0100 Subject: [PATCH] Update docker-image.yml --- .github/workflows/docker-image.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 1504950..12f18f2 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,22 +1,15 @@ -name: Build and Push Docker Image +name: Docker Image CI on: push: - branches: - - main + branches: [ "main" ] + pull_request: + branches: [ "main" ] jobs: build: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Login to Docker Hub - run: docker login -u ${{ DockerHub.DOCKERHUB_USERNAME }} -p ${{ DockerHub.DOCKERHUB_TOKEN }} - - - name: Build and push Docker image - run: | - docker build -t ${{ DockerHub.DOCKERHUB_USERNAME }}/ddns-online-scaleway:latest . - docker push ${{ DockerHub.DOCKERHUB_USERNAME }}/ddns-online-scaleway:latest + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag ddns-online-scaleway:$(date +%s)