Skip to content

Commit e572da8

Browse files
authored
Merge pull request #28 from Bernardo-MG/ci_scripts
No longer using action to deploy site
2 parents 3554572 + 29a86b9 commit e572da8

1 file changed

Lines changed: 68 additions & 22 deletions

File tree

.github/workflows/testing.yml

Lines changed: 68 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,74 @@ jobs:
77
name: Tests
88
uses: Bernardo-MG/github-workflow/.github/workflows/python_testing.yml@develop
99

10-
deploy_develop_docs:
11-
name: Deploy development docs
10+
setup_docs:
11+
name: Doc deployment preparation
1212
needs: tests
13-
uses: Bernardo-MG/github-workflow/.github/workflows/python_deploy_site.yml@develop
14-
with:
15-
branch: develop
16-
host: docs.bernardomg.com
17-
secrets:
18-
port: ${{ secrets.DEPLOY_DOCS_DEVELOP_PORT }}
19-
path: ${{ secrets.DEPLOY_DOCS_DEVELOP_PATH }}
20-
username: ${{ secrets.DEPLOY_DOCS_DEVELOP_USER }}
21-
password: ${{ secrets.DEPLOY_DOCS_DEVELOP_PASSWORD }}
13+
outputs:
14+
branchName: ${{ steps.extract_branch.outputs.branchName }}
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Install sshpass
19+
run: sudo apt-get install sshpass
20+
- name: Extract branch name
21+
uses: bernardo-mg/extract-branch-name-action@v1
22+
id: extract_branch
2223

2324
deploy_docs:
24-
name: Deploy docs
25-
needs: tests
26-
uses: Bernardo-MG/github-workflow/.github/workflows/python_deploy_site.yml@develop
27-
with:
28-
branch: master
29-
host: docs.bernardomg.com
30-
secrets:
31-
port: ${{ secrets.DEPLOY_DOCS_PORT }}
32-
path: ${{ secrets.DEPLOY_DOCS_PATH }}
33-
username: ${{ secrets.DEPLOY_DOCS_USER }}
34-
password: ${{ secrets.DEPLOY_DOCS_PASSWORD }}
25+
name: Deploy development docs
26+
environment: deployment_site
27+
needs: setup_docs
28+
runs-on: ubuntu-latest
29+
if: ${{ needs.setup_docs.outputs.branchName == 'master' }}
30+
steps:
31+
- name: Check-out
32+
uses: actions/checkout@v2
33+
- name: Set up Python
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: 3.9
37+
cache: 'pip'
38+
- name: Update pip
39+
run: python -m pip install --upgrade pip
40+
- name: Install dependencies
41+
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
42+
- name: Install sshpass
43+
run: sudo apt-get install sshpass
44+
- name: Tests docs
45+
run: python setup.py test -p docs
46+
- name: Build docs
47+
run: python setup.py build_docs
48+
- name: Move to deployment folder
49+
run: cd ./build/sphinx/html
50+
- name: Deploy docs
51+
run: sshpass -p ${{ secrets.DEPLOY_DOCS_PASSWORD }} scp -o StrictHostKeyChecking=no -P ${{ secrets.DEPLOY_DOCS_PORT }} -r ./src ${{ secrets.DEPLOY_DOCS_USER }}'@'${{ secrets.DEPLOY_DOCS_HOST }}':'${{ secrets.DEPLOY_DOCS_PATH }};
52+
53+
deploy_develop_docs:
54+
name: Deploy development docs
55+
environment: deployment_site
56+
needs: setup_docs
57+
runs-on: ubuntu-latest
58+
if: ${{ needs.setup_docs.outputs.branchName == 'master' }}
59+
steps:
60+
- name: Check-out
61+
uses: actions/checkout@v2
62+
- name: Set up Python
63+
uses: actions/setup-python@v2
64+
with:
65+
python-version: 3.9
66+
cache: 'pip'
67+
- name: Update pip
68+
run: python -m pip install --upgrade pip
69+
- name: Install dependencies
70+
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
71+
- name: Install sshpass
72+
run: sudo apt-get install sshpass
73+
- name: Tests docs
74+
run: python setup.py test -p docs
75+
- name: Build docs
76+
run: python setup.py build_docs
77+
- name: Move to deployment folder
78+
run: cd ./build/sphinx/html
79+
- name: Deploy docs
80+
run: sshpass -p ${{ secrets.DEPLOY_DOCS_DEVELOP_PASSWORD }} scp -o StrictHostKeyChecking=no -P ${{ secrets.DEPLOY_DOCS_PORT }} -r ./src ${{ secrets.DEPLOY_DOCS_DEVELOP_USER }}'@'${{ secrets.DEPLOY_DOCS_HOST }}':'${{ secrets.DEPLOY_DOCS_DEVELOP_PATH }};

0 commit comments

Comments
 (0)