Skip to content

Commit

Permalink
Use ESMF_WEB_DEPLOY_KEY in build-esmpy-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
danrosen25 authored Aug 23, 2023
1 parent 99d1bf3 commit f53a1b7
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/build-esmpy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ jobs:
with:
name: esmpy-docs
path: ${{ github.workspace }}/artifacts

- name: Checkout esmpy_doc
uses: actions/checkout@v3
with:
repository: esmf-org/esmpy_doc
path: esmpy_doc
token: ${{ secrets.ESMF_WEB_TOKEN }}

- name: Setup deployment
run: |
mkdir -p ~/.ssh
if [ -z "${{secrets.ESMF_WEB_DEPLOY_KEY}}" ]; then
echo "ERROR: Missing ESMF_WEB_DEPLOY_KEY!"
exit 1
fi
echo "${{secrets.ESMF_WEB_DEPLOY_KEY}}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
git config --global user.name "ESMF-Bot"
git config --global user.email "[email protected]"
git clone --depth=1 [email protected]:esmf-org/esmpy_doc.git ${{ github.workspace }}/esmpy_doc
- name: Copy docs
run: |
Expand All @@ -60,10 +66,8 @@ jobs:
cp -rf latex/ESMPy.pdf ${{ github.workspace }}/esmpy_doc/docs/nightly/${{ github.ref_name }}/
- name: Commit and publish docs
uses: actions-js/push@master
with:
repository: esmf-org/esmpy_doc
directory: ${{ github.workspace }}/esmpy_doc
branch: master
github_token: ${{ secrets.ESMF_WEB_TOKEN }}
message: 'Publish ESMPy Docs'
run: |
cd ${{ github.workspace }}/esmpy_doc
git diff-index --quiet HEAD || git commit --message "Publish ESMPy Docs"
git push origin
rm ~/.ssh/id_rsa

0 comments on commit f53a1b7

Please sign in to comment.