CI
Some checks are pending
CI / lint-test (push) Waiting to run
CI / build-api (push) Blocked by required conditions
CI / build-web (push) Blocked by required conditions

This commit is contained in:
Igor Rybakov
2026-03-07 12:45:34 +02:00
parent d2a8ec9e81
commit a65f86a28b
2 changed files with 31 additions and 32 deletions

View File

@@ -4,16 +4,11 @@ on:
push:
branches:
- main
pull_request:
- dev
permissions:
actions: read
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_PREFIX: ${{ github.repository }}
jobs:
lint-test:
@@ -42,23 +37,12 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push API image
- name: Build API image
uses: docker/build-push-action@v6
with:
context: .
file: apps/api/Dockerfile
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/api:latest
${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/api:${{ github.sha }}
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
@@ -71,22 +55,11 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Web image
- name: Build Web image
uses: docker/build-push-action@v6
with:
context: .
file: apps/web/Dockerfile
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/web:latest
${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/web:${{ github.sha }}
push: false
cache-from: type=gha
cache-to: type=gha,mode=max

26
.github/workflows/pr.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: PR Check
on:
pull_request:
permissions:
actions: read
contents: read
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
filter: tree:0
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- uses: nrwl/nx-set-shas@v4
- run: npx nx affected -t lint test typecheck