-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: docpublish upload to azure instead of nordicsemi
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
Showing
2 changed files
with
16 additions
and
33 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 |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
- completed | ||
|
||
jobs: | ||
build: | ||
publish: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
|
@@ -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: | | ||
|
@@ -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 |
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 |
---|---|---|
|
@@ -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 |