Skip to content

Commit

Permalink
ci: docpublish upload to azure instead of nordicsemi
Browse files Browse the repository at this point in the history
There is a plan to deprecate developer.nordicsemi.com
for hosting documentation builds. Instead we plan to use
Azure storage.

Signed-off-by: Kari Hamalainen <[email protected]>
  • Loading branch information
karhama committed Nov 13, 2024
1 parent 16cb2bc commit 79dbb1a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 33 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/docpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- completed

jobs:
build:
publish:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
Expand All @@ -17,23 +17,19 @@ jobs:
workflow: docbuild.yml
run_id: ${{ github.event.workflow_run.id }}

- name: Install dependencies
- name: Unzip html archive
working-directory: docs
run: |
sudo apt install -y sshpass
OUTDIR=$(awk 'NR==1 { if ($3 ~ /^(latest|v([0-9a-z\.\-]+)|PR-[0-9]+)$/) print $3 }' monitor_*.txt)
echo "OUTDIR=$OUTDIR" >> "$GITHUB_ENV"
unzip legacy-ncs*.zip -d $OUTDIR
- name: Upload documentation
- name: Upload to Azure storage
working-directory: docs
env:
SSHUSER: ${{ secrets.NCS_TRANSFER_DOC_USR }}
SSHPASS: ${{ secrets.NCS_TRANSFER_DOC_PWD }}
AZCOPY_CONCURRENCY_VALUE: 1024
run: |
# trust server
mkdir -p ~/.ssh && \
ssh-keyscan -p 2222 transfer.nordicsemi.no >> ~/.ssh/known_hosts
# upload files
for file in docs/legacy*.zip docs/monitor*.txt; do
echo "put ${file}" | \
sshpass -e sftp -P 2222 -o BatchMode=no -b - [email protected]
done
azcopy cp $OUTDIR "${{ vars.NCS_DOC_STORAGE_URL }}?${{ secrets.NCS_DOC_SAS}}" --recursive=true
- name: Upload Zoomin documentation
run: |
Expand Down Expand Up @@ -74,9 +70,9 @@ jobs:
done
- name: Add preview URL comment for PRs
uses: carlescufi/action-doc-url@main
uses: nrfconnect/action-doc-url@main
with:
github-token: ${{ secrets.NCS_GITHUB_TOKEN }}
urlroot: ${{ secrets.NCS_DOC_URL_ROOT }}
urlroot: ${{ vars.NCS_DOC_HOSTING_URL }}
pr-prefix: "PR-"
pr-file: docs/pr.txt
21 changes: 4 additions & 17 deletions .github/workflows/docremove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,11 @@ on:
- main

jobs:
build:
remove:
runs-on: ubuntu-latest

steps:
- name: Install dependencies
run: |
sudo apt install -y sshpass
- name: Request removal
- name: Try removal of PR-docs
env:
SSHUSER: ${{ secrets.NCS_TRANSFER_DOC_USR }}
SSHPASS: ${{ secrets.NCS_TRANSFER_DOC_PWD }}
AZCOPY_CONCURRENCY_VALUE: 3000
run: |
# create request file
echo "remove PR-${{ github.event.number }}" > monitor_${GITHUB_RUN_ID}.txt
# trust server
mkdir -p ~/.ssh && \
ssh-keyscan -p 2222 transfer.nordicsemi.no >> ~/.ssh/known_hosts
# upload request file
echo "put monitor_${GITHUB_RUN_ID}.txt" | \
sshpass -e sftp -P 2222 -o BatchMode=no -b - [email protected]
azcopy rm "${{ vars.NCS_DOC_STORAGE_URL }}PR-${{ github.event.number }}?${{ secrets.NCS_DOC_SAS }}" --recursive=true || true

0 comments on commit 79dbb1a

Please sign in to comment.