Skip to content

Обновление зависимостей #6

Обновление зависимостей

Обновление зависимостей #6

Workflow file for this run

name: Создание github containers
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
check-tags:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.version.outputs.tag }}
release: ${{ steps.version.outputs.release }}
steps:
- name: Скачивание репозитория
uses: actions/checkout@v7
with:
submodules: recursive
- name: Определение версии
id: version
run: |
tag=false
release=false
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
TAG_NAME="${GITHUB_REF#refs/tags/}"
echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
SEGMENTS=$(echo "$TAG_NAME" | tr '.' '\n' | wc -l)
if [ "$SEGMENTS" -le 3 ]; then
echo "release=true" >> $GITHUB_OUTPUT
else
echo "release=false" >> $GITHUB_OUTPUT
fi
else
echo "tag=false" >> $GITHUB_OUTPUT
echo "release=false" >> $GITHUB_OUTPUT
fi
build:
needs: check-tags
if: needs.check-tags.outputs.tag != 'false'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- service: app
dockerfile: ./Dockerfile
context: .
- service: signaling
dockerfile: ./signaling/Dockerfile
context: ./signaling
steps:
- name: Скачивание репозитория
uses: actions/checkout@v7
with:
submodules: recursive
- name: Вход в GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Сборка и публикация образа (${{ matrix.service }})
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: true
tags: |
ghcr.io/${{ github.repository }}-${{ matrix.service }}:${{ needs.check-tags.outputs.tag }}
ghcr.io/${{ github.repository }}-${{ matrix.service }}:latest
create-release:
runs-on: ubuntu-latest
needs: check-tags
if: needs.check-tags.outputs.release == 'true'
permissions:
contents: write
steps:
- name: Создание релиза
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.check-tags.outputs.tag }}
name: Релиз ${{ needs.check-tags.outputs.tag }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}