mirror of
https://ak-git.vectorsigma.ru/terghalin/metalcheck.git
synced 2026-04-07 22:07:43 +09:00
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: CI Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
IMAGE_NAME: terghalin/metalcheck
|
|
|
|
jobs:
|
|
build-and-push:
|
|
name: Build and Push Docker Image
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.IMAGE_REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.CI_TOKEN }}
|
|
|
|
- name: Cache Python dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Build and Push Docker Image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
push: true
|
|
tags: |
|
|
${{ vars.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
|
${{ vars.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
|
${{ vars.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
|