mirror of
https://github.com/n08i40k/schedule-parser-next.git
synced 2025-12-06 17:57:45 +03:00
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: Docker
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master" ]
|
|
tags: [ 'v*.*.*' ]
|
|
|
|
env:
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
REGISTRY_HOST: registry.n08i40k.ru
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
|
|
|
|
- name: Log into registry
|
|
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
|
|
with:
|
|
registry: ${{ env.REGISTRY_HOST }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.REGISTRY_PASSWD }}
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
|
|
with:
|
|
images: ${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}
|
|
|
|
- name: Build and push Docker image
|
|
id: build-and-push
|
|
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
|
|
with:
|
|
context: .
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
push: true |