Create pipeline.yml

This commit is contained in:
IvayloRashkov 2025-02-17 16:52:10 +02:00 committed by GitHub
parent aec1964410
commit fe31675916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

38
.github/workflows/pipeline.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name:CI-Build
on:
pull_request:
types: [closed]
branches: ["master"]
jobs:
build-docker-image:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in Docker Hub Container Registry
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push in Docker Hub Registry
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: user/app:latest