docs: upd readme description #64
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/[email protected] | |
- uses: pre-commit/[email protected] | |
is-frontend-changed: | |
name: 👁️🗨️ Check Frontend Changes | |
runs-on: ubuntu-latest | |
needs: | |
- check | |
outputs: | |
frontend: ${{ steps.filter.outputs.frontend }} | |
steps: | |
- uses: actions/[email protected] | |
- 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/[email protected] | |
- name: Login to GitHub Container Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/[email protected] | |
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/[email protected] | |
with: | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
- name: Build and push Docker image | |
id: push | |
uses: docker/[email protected] | |
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/[email protected] | |
- name: Run playbook | |
uses: dawidd6/[email protected] | |
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 |