-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy scripts using GitHub Actions (#331)
* deploy to aiqm/torchani-test-docs for testing * Deploy to test PyPI on PR * update * fix tag version * fix docs deploy format * test * fix * deploy docs on release * update * deploy pypi * update readme
- Loading branch information
Showing
5 changed files
with
149 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: deploy-docs | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.7] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
ci/install_dependencies.sh | ||
pip install h5py pytorch-ignite tb-nightly sphinx sphinx_rtd_theme matplotlib pillow sphinx-gallery | ||
pip install . | ||
- name: Download data files | ||
run: ./download.sh | ||
# double check that this is indeed run under a release | ||
- name: Fail build on non-release commits | ||
run: git describe --exact-match --tags HEAD | ||
# build docs | ||
- name: Build documents | ||
run: sphinx-build docs build | ||
# try deploying | ||
- name: Set up environments | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo ${{secrets.zasdfgbnm_bot_private_key}} | base64 -d > ~/.ssh/id_rsa | ||
chmod 0600 ~/.ssh/id_rsa | ||
echo ${{secrets.zasdfgbnm_bot_public_key}} > ~/.ssh/id_rsa.pub | ||
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts | ||
git config --global user.email "zasdfgbnm-bot@example.com" | ||
git config --global user.name "zasdfgbnm-bot" | ||
- name: Deploy | ||
run: | | ||
git clone git@github.com:aiqm/torchani.git deploy_dir -b gh-pages | ||
rm -rf deploy_dir/* | ||
touch deploy_dir/.nojekyll | ||
cp -r build/* deploy_dir | ||
cd deploy_dir | ||
git add . | ||
git commit -m "update" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: deploy-pypi | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.7] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Fail build on non-release commits | ||
run: git describe --exact-match --tags HEAD | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install twine wheel | ||
- name: Deploy | ||
run: | | ||
rm -rf dist/* | ||
git tag $(date +'v%Y.%m.%d.%H.%M.%S') | ||
python setup.py bdist bdist_wheel | ||
twine upload -u zasdfgbnm-bot -p ${{secrets.zasdfgbnm_bot_pypi_password}} dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: deploy-test-pypi | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.7] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install twine wheel | ||
- name: Deploy | ||
run: | | ||
rm -rf dist/* | ||
git tag $(date +'v%Y.%m.%d.%H.%M.%S') | ||
python setup.py bdist bdist_wheel | ||
twine upload --repository-url https://test.pypi.org/legacy/ -u zasdfgbnm-bot -p ${{secrets.zasdfgbnm_bot_test_pypi_password}} dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters