-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (116 loc) · 3.39 KB
/
deploy.yml
File metadata and controls
136 lines (116 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# GitHub Actions workflow for deploying the Codebase Interface landing page
name: Deploy Landing Page
on:
push:
branches:
- main
schedule:
# Daily sync at 6 AM UTC to pull updates from external repositories
- cron: '0 6 * * *'
workflow_dispatch:
inputs:
force_rebuild:
description: 'Force rebuild of all content'
required: false
default: 'false'
# Allow only one deployment at a time
concurrency:
group: "deploy"
cancel-in-progress: false
# Sets permissions for GitHub Pages deployment
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
- name: Setup Task
uses: arduino/setup-task@v1
with:
version: 3.x
- name: Install Python dependencies via Task
run: task setup
- name: Setup Node.js (for Lighthouse)
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install markdown linting tools
run: |
npm install -g markdownlint-cli
echo "✅ Linting tools installed"
- name: Validate configuration
run: |
task validate
echo "✅ Configuration and linting validation passed"
- name: Build production landing page
run: |
task build-production
echo "✅ Production landing page built successfully"
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./site
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
lighthouse:
needs: deploy
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Lighthouse CI
run: npm install -g @lhci/cli
- name: Run Lighthouse CI
run: |
lhci autorun --upload.target=temporary-public-storage
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment PR with Lighthouse results
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🔍 Lighthouse audit completed! Check the results in the workflow logs.'
});
notify:
needs: [deploy, lighthouse]
runs-on: ubuntu-latest
if: always()
steps:
- name: Notify deployment status
run: |
if [ "${{ needs.deploy.result }}" == "success" ]; then
echo "🚀 Landing page successfully deployed to https://codebase-interface.github.io"
else
echo "❌ Deployment failed"
exit 1
fi