From bd78c3952044e17048afd59b410d7f2d5c9dba50 Mon Sep 17 00:00:00 2001 From: LucifersCircle Date: Fri, 29 Nov 2024 03:22:34 -0800 Subject: [PATCH] Update build-and-push.yml --- .github/workflows/build-and-push.yml | 29 +++++++++++++--------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 5dcda4b..d2c05b1 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -1,4 +1,4 @@ -name: Build and Deploy Docker Image +name: Build and Push Docker Image on: push: @@ -7,28 +7,25 @@ on: workflow_dispatch: jobs: - build: + build-and-push: runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout code uses: actions/checkout@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Cache Docker layers - uses: actions/cache@v3 + - name: Log in to DockerHub + uses: docker/login-action@v2 with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-docker-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-docker- + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build Docker image - run: | - docker build --file Dockerfile --tag luciferscircle/redlib . - - - name: Push Docker image - run: | - docker push luciferscircle/redlib + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: luciferscircle/redlib:latest