Files
django-example-app/.github/workflows/docker-build.yaml
Basyrov Rustam 0a8bd3e4ef
All checks were successful
CI-pipeline / linters (pull_request) Successful in 39s
Build and push Docker image / build-and-push (pull_request) Has been skipped
don't need a rebuild docker if files not touched
2025-06-06 13:31:29 +03:00

42 lines
930 B
YAML

name: Build and push Docker image
on:
workflow_dispatch:
pull_request:
branches:
- main
types:
- closed
paths:
- Dockerfile
- requirements.txt
- manage.py
jobs:
build-and-push:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Getting the codebase
uses: actions/checkout@v4
with:
ref: main
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Push to hub
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/django-example-app:latest