fix: clamp max level #107
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-workflow | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
pull_request: | |
branches: | |
- master | |
jobs: | |
check: | |
name: 🛠️ Run Pre-commit Hooks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.7 | |
- uses: pre-commit/action@v3.0.1 | |
is-frontend-changed: | |
name: 👁️🗨️ Check Frontend Changes | |
runs-on: ubuntu-latest | |
needs: | |
- check | |
outputs: | |
frontend: ${{ steps.filter.outputs.frontend }} | |
steps: | |
- uses: actions/checkout@v4.1.7 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
frontend: | |
- 'web/**' | |
build-frontend: | |
name: 🏗️ Run Frontend Build | |
runs-on: ubuntu-latest | |
if: needs.is-frontend-changed.outputs.frontend == 'true' | |
environment: dev | |
permissions: | |
contents: read | |
packages: write | |
needs: | |
- is-frontend-changed | |
steps: | |
- uses: actions/checkout@v4.1.7 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5.5.1 | |
with: | |
images: ghcr.io/akorzunin/supericosahedron-frontend | |
tags: | | |
- type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3.6.1 | |
with: | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
- name: Build and push Docker image | |
id: push | |
uses: docker/build-push-action@v6.5.0 | |
with: | |
context: . | |
push: true | |
build-args: | | |
VITE_HOST_URL=${{ vars.VITE_HOST_URL }} | |
VITE_OG_DESCRIPTION=${{ vars.VITE_OG_DESCRIPTION }} | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
file: ./web/Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
deploy-frontend: | |
name: 🚢 Deploy Frontend Docker Image | |
runs-on: ubuntu-latest | |
environment: dev | |
needs: | |
- build-frontend | |
defaults: | |
run: | |
working-directory: deploy/dev | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4.1.7 | |
- name: Run playbook | |
uses: dawidd6/action-ansible-playbook@v2.8.0 | |
with: | |
playbook: deploy_frontend.yaml | |
directory: deploy/dev | |
configuration: | | |
[defaults] | |
callbacks_enabled = ansible.posix.profile_tasks, ansible.posix.timer | |
stdout_callback = yaml | |
host_key_checking = false | |
interpreter_python = /usr/bin/python | |
[ssh_connection] | |
retries=5 | |
vault_password: ${{ secrets.ANSIBLE_PASS }} | |
inventory: ${{ vars.ANSIBLE_HOSTS }} | |
options: | | |
--inventory .hosts | |
--limit ${{ vars.DEV_SERVER }} | |
--verbose |