-
-
Notifications
You must be signed in to change notification settings - Fork 49
104 lines (87 loc) · 2.62 KB
/
Copy pathci.yml
File metadata and controls
104 lines (87 loc) · 2.62 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
---
name: OpenWISP Website CI Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: 3.13
cache: "pip"
cache-dependency-path: |
**/requirements*.txt
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
- name: Install test dependencies
run: |
yarn install
pip install -U pip setuptools wheel
pip install -r requirements.txt
- name: QA checks
run: ./run-qa-checks
- name: Build
run: make publish
- name: Upload build output
uses: actions/upload-artifact@v4
with:
name: site-output
path: output/
deploy:
if: >
github.repository == 'openwisp/OpenWISP-Website' &&
github.event_name == 'push'
runs-on: ubuntu-24.04
needs: build
steps:
- name: Download build output
uses: actions/download-artifact@v4
with:
name: site-output
path: output/
- name: Setup Google Cloud
uses: "google-github-actions/auth@v3"
with:
credentials_json: ${{ secrets.GCS_DOWNLOADS_SERVICE_ACCOUNT_JSON }}
project_id: ${{ secrets.GCS_PROJECT_ID }}
export_environment_variables: true
- name: Set up Cloud SDK
uses: "google-github-actions/setup-gcloud@v3"
- name: Deploy pages to openwisp.org
run: gsutil -m rsync -r ${{ env.SRC_URL }} ${{ env.DST_URL }}
env:
SRC_URL: /home/runner/work/OpenWISP-Website/OpenWISP-Website/output/
DST_URL: gs://${{ secrets.GCS_WEBSITE_BUCKET_NAME }}/
invalidate-cache:
runs-on: ubuntu-latest
if: >
github.repository == 'openwisp/OpenWISP-Website' &&
github.event_name == 'push'
needs: deploy
steps:
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.GCS_DOWNLOADS_SERVICE_ACCOUNT_JSON }}
project_id: ${{ secrets.GCS_PROJECT_ID }}
export_environment_variables: true
- name: Invalid CDN cache on GCP
uses: stefanodotit/github-actions-invalidate-gcp-cdn@v1
with:
load_balancer_name: ${{ secrets.GCS_MAIN_LOAD_BALANCER_NAME }}
host: openwisp.org
path: "/*"