Update Nginx config according to deprecation warning #312
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI/CD Pipeline" | |
on: | |
push: | |
branches: | |
- 'master' | |
- 'release/**' | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- ready_for_review | |
- synchronize | |
concurrency: | |
group: cicd-pipeline-${{ github.workflow }}-${{ github.event.pull_request.number || github.event.pull_request.head.ref || github.ref }} | |
env: | |
registry_name: nochlezhka | |
app_image_name: mks-app | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout (PR) | |
uses: actions/checkout@v4 | |
if: github.event_name == 'pull_request' | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
- name: Checkout (Push) | |
uses: actions/checkout@v4 | |
if: github.event_name == 'push' | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set application version | |
if: github.event_name == 'push' | |
id: set_version | |
uses: kvendingoldo/[email protected] | |
with: | |
primary_branch: master | |
enable_github_releases: true | |
github_token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Set application version (PR) | |
if: github.event_name == 'pull_request' | |
run: | | |
echo "VERSION_PR=$(date '+%Y%m%d-%H%M%S')-$(echo $GITHUB_SHA | cut -c1-8)" >> $GITHUB_ENV | |
- name: Build app docker image and push it | |
uses: docker/build-push-action@v6 | |
env: | |
DOCKER_BUILD_SUMMARY: false | |
with: | |
context: . | |
file: ./docker/app/Dockerfile | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: | | |
${{ env.registry_name }}/${{ env.app_image_name }}:${{ steps.set_version.outputs.safe_version }}${{ env.VERSION_PR }} | |
- name: Print image version | |
run: echo ${{ steps.set_version.outputs.safe_version }} | |
- name: Output image version | |
run: | | |
echo '### Image version: ' >> $GITHUB_STEP_SUMMARY | |
echo '${{ steps.set_version.outputs.safe_version }}${{ env.VERSION_PR }}' >> $GITHUB_STEP_SUMMARY | |
- name: Telegram success notification | |
uses: appleboy/telegram-action@master | |
if: success() | |
with: | |
format: markdown | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: | | |
*[mks]* | |
✅ Version *${{ steps.set_version.outputs.safe_version }}${{ env.VERSION_PR }}* has been built successfully from *${{ github.ref }}* branch | |
- name: Telegram failure notification | |
uses: appleboy/telegram-action@master | |
if: failure() | |
with: | |
format: markdown | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: | | |
*[mks]* | |
❗ Build has been failed for *${{ github.ref }}*. Please check: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |