Update build-and-push.yml

This commit is contained in:
LucifersCircle 2024-11-29 03:22:34 -08:00
parent 3cbfdde94f
commit bd78c39520

View file

@ -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