Skip to content

Commit 67a3bb6

Browse files
authored
Merge pull request #58 from Raphael-Gazzotti/pipeline-redirection-map
Pipeline - Post-build deployment of the .htaccess file.
2 parents e61ad31 + d385adc commit 67a3bb6

2 files changed

Lines changed: 42 additions & 3 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: htaccess-deploy
2+
3+
on:
4+
workflow_run:
5+
workflows: ["openMINDS_documentation_build_pipeline"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
deploy:
11+
# Run only if the previous workflow succeeded
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
ref: pipeline
20+
21+
- name: Set up environment
22+
run: |
23+
echo "Running post-build deployment for .htaccess"
24+
cd pipeline
25+
pip install -r requirements.txt
26+
python pipeline/redirect_map.py
27+
28+
- name: Upload .htaccess via SFTP
29+
env:
30+
FTP_SERVER: ${{ secrets.FTP_SERVER }}
31+
SFTP_PORT: ${{ secrets.SFTP_PORT }}
32+
FTP_USER: ${{ secrets.FTP_USER }}
33+
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
34+
run: |
35+
lftp -u "$FTP_USER","$FTP_PASSWORD" -p $SFTP_PORT sftp://$FTP_SERVER <<EOF
36+
lcd pipeline
37+
put .htaccess -o /public_html/.htaccess
38+
bye
39+
EOF

pipeline/redirect_map.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"""
1515

1616
from __future__ import annotations
17-
17+
from concurrent.futures import ThreadPoolExecutor, as_completed
1818
import os
1919
from typing import Dict
2020

21-
from pipeline.utils import clone_sources, SchemaLoader, InstanceLoader
2221
import requests
23-
from concurrent.futures import ThreadPoolExecutor, as_completed
22+
23+
from utils import clone_sources, SchemaLoader, InstanceLoader
2424

2525
# Helper functions
2626

0 commit comments

Comments
 (0)