Change here string to pipe #731
Workflow file for this run
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
name: Build ESMF Docs | |
on: | |
workflow_dispatch: | |
push: | |
concurrency: | |
group: build-esmf-docs-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Dockerfiles | |
uses: actions/checkout@v3 | |
with: | |
repository: esmf-org/esmf-containers | |
path: esmf-containers | |
ref: main | |
- name: Build Docker image | |
run: | | |
cd ${{ github.workspace }}/esmf-containers/build-esmf-docs/esmf | |
docker build . --tag esmf/build-esmf-docs --build-arg ESMF_BRANCH="${{ github.ref_name }}" --no-cache | |
- name: Extract artifacts | |
run: | | |
mkdir -p ${{ github.workspace }}/artifacts | |
CID=$(docker run -dit --name runner esmf/build-esmf-docs) | |
docker cp ${CID}:/artifacts/doc-artifacts.zip ${{ github.workspace }}/artifacts | |
docker stop ${CID} | |
docker rm ${CID} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: esmf-docs | |
path: ${{ github.workspace }}/artifacts | |
- name: Setup deployment | |
env: | |
SSH_AUTH_SOCK: ${{runner.temp}}/ssh_agent.sock | |
run: | | |
mkdir -p ~/.ssh | |
if [ -z "${{secrets.ESMF_WEB_DEPLOY_KEY}}" ]; then | |
echo "ERROR: Missing ESMF_WEB_DEPLOY_KEY!" | |
exit 1 | |
fi | |
set +o history | |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
echo "${{secrets.ESMF_WEB_DEPLOY_KEY}}" | ssh-add - | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git clone --depth=1 [email protected]:esmf-org/esmf-org.github.io.git ${{ github.workspace }}/esmf-org.github.io | |
- name: Copy docs | |
run: | | |
cd ${{ github.workspace }}/esmf-org.github.io | |
mkdir -p docs/nightly/${{ github.ref_name }}/dev_guide | |
cd ${{ github.workspace }}/artifacts | |
unzip doc-artifacts.zip | |
cd ${{ github.workspace }}/artifacts/artifacts/doc-esmf | |
cp -rf ./* ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/ | |
cd ${{ github.workspace }}/artifacts/artifacts/doc-nuopc | |
cp -rf NUOPC_refdoc ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/ | |
cp -rf NUOPC_refdoc.pdf ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/ | |
cp -rf NUOPC_howtodoc ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/ | |
cp -rf NUOPC_howtodoc.pdf ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/ | |
cd ${{ github.workspace }}/artifacts/artifacts/doc-dev_guide | |
cp -rf ./dev_guide/dev_guide/* ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/dev_guide/ | |
- name: Commit and publish docs | |
env: | |
SSH_AUTH_SOCK: ${{runner.temp}}/ssh_agent.sock | |
run: | | |
cd ${{ github.workspace }}/esmf-org.github.io | |
git add . | |
git diff-index --quiet HEAD || git commit --message "Publish ESMF Docs" | |
git push origin | |
ssh-add -D |