Skip to content

Commit 45ec415

Browse files
authored
chore: add nginx conf and deploy workflow (#3268)
Nginx will be deployed on change in `nginx.conf` file on master branch. Currently, the triggered workflow in `apify-docs-private` does nothing, so it completely safe to merge it. This will be used, when we separate `crawlee` from `apify-docs` nginx.
1 parent 6c76d32 commit 45ec415

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/deploy-nginx.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Triggers deployment of the Nginx reverse proxy configuration for crawlee.dev
2+
# when the configuration file is updated in this repository.
3+
name: Deploy Nginx Configuration
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
paths:
10+
- 'website/nginx.conf'
11+
12+
jobs:
13+
trigger-deployment:
14+
name: Trigger Nginx deployment
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Trigger deployment workflow in apify-docs-private
18+
run: |
19+
gh workflow run deploy-nginx.yml \
20+
--repo apify/apify-docs-private \
21+
--field deployment=crawlee-docs
22+
echo "✅ Deployment workflow triggered successfully"
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

website/nginx.conf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Nginx reverse proxy configuration for crawlee.dev
2+
# Routes to GitHub Pages and handles legacy URL redirects
3+
server {
4+
listen 0.0.0.0:8080;
5+
server_name 'crawlee.dev';
6+
location / {
7+
proxy_pass https://apify.github.io/crawlee/;
8+
}
9+
location /python {
10+
proxy_pass https://apify.github.io/crawlee-python/;
11+
}
12+
13+
# So that we can have both GH pages and crawlee.dev/python working and loading assets from the same path
14+
location /crawlee-python {
15+
proxy_pass https://apify.github.io/crawlee-python/;
16+
}
17+
18+
# Redirect rule for old JS docs to go under /js prefix
19+
rewrite ^/docs(.*)$ /js/docs$1 permanent;
20+
rewrite ^/api(.*)$ /js/api$1 permanent;
21+
22+
# Remove version numbers from /js/api/3.[0-9]/* and /js/docs/3.[0-9]/*
23+
rewrite ^/js/api/3\.\d(/.*)?$ /js/api$1 permanent;
24+
rewrite ^/js/docs/3\.\d(/.*)?$ /js/docs$1 permanent;
25+
26+
# Redirect rule for "upgrading-to-v03" to "upgrading-to-v0x"
27+
rewrite ^/python/docs/upgrading/upgrading-to-v03$ /python/docs/upgrading/upgrading-to-v0x permanent;
28+
29+
# Redirect rule so that /python/docs actually leads somewhere
30+
rewrite ^/python/docs/?$ /python/docs/quick-start;
31+
32+
rewrite ^/versions/?$ /js/api/core/changelog permanent;
33+
}

0 commit comments

Comments
 (0)