Skip to content

Commit eb3e576

Browse files
committed
ci: consolidate workflows, gate deploy on quality checks
1 parent 8f6077b commit eb3e576

2 files changed

Lines changed: 42 additions & 51 deletions

File tree

.github/workflows/ci.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
name: CI
1+
name: CI / Deploy
22

33
on:
44
push:
55
branches: [main]
66
pull_request:
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
914
concurrency:
1015
group: ci-${{ github.ref }}
1116
cancel-in-progress: true
@@ -31,3 +36,39 @@ jobs:
3136

3237
- name: Unit tests + 100% coverage
3338
run: bun run test:coverage
39+
40+
build:
41+
needs: quality
42+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- uses: oven-sh/setup-bun@v2
48+
with:
49+
bun-version: 1.3.14
50+
51+
- name: Install dependencies
52+
run: bun install --frozen-lockfile
53+
54+
- name: Build (EN + RU, prerendered)
55+
run: bun run build
56+
57+
- name: Assemble site root (redirect, robots, sitemap, og-image)
58+
run: node scripts/assemble-dist.mjs
59+
60+
- name: Upload Pages artifact
61+
uses: actions/upload-pages-artifact@v3
62+
with:
63+
path: dist/ngportfolio/browser
64+
65+
deploy:
66+
needs: build
67+
runs-on: ubuntu-latest
68+
environment:
69+
name: github-pages
70+
url: ${{ steps.deployment.outputs.page_url }}
71+
steps:
72+
- name: Deploy to GitHub Pages
73+
id: deployment
74+
uses: actions/deploy-pages@v4

.github/workflows/deploy.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)