Skip to content

made workflow adjustments 15 #15

made workflow adjustments 15

made workflow adjustments 15 #15

Workflow file for this run

name: Build and Push Docker Images
on:
push:
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Django Image
uses: docker/build-push-action@v5
with:
context: ./hello_django
file: ./Dockerfile.dev
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/app:${{ github.sha }}
${{ secrets.DOCKERHUB_USERNAME }}/app:latest
- name: Build and Push Nginx Image
uses: docker/build-push-action@v5
with:
context: ./nginx
file: ./nginx/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/nginx-proxy:${{ github.sha }}
${{ secrets.DOCKERHUB_USERNAME }}/nginx-proxy:latest