fix(docs): deploy external and internal docs with the correct path (#7338)

* fix(docs): use specific variables to avoid using  an `environment`

* fix(docs): build and publish the correct paths

* fix(docs): remove all environments
This commit is contained in:
Gustavo Valverde 2023-08-16 23:16:55 +01:00 committed by GitHub
parent b0003076c3
commit 5eaaeae08c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 19 deletions

View File

@ -16,6 +16,7 @@ on:
# doc source files
- 'book/**'
- '**/firebase.json'
- '**/.firebaserc'
- 'katex-header.html'
# rustdoc source files
- '**/*.rs'
@ -34,6 +35,7 @@ on:
# doc source files
- 'book/**'
- '**/firebase.json'
- '**/.firebaserc'
- 'katex-header.html'
# rustdoc source files
- '**/*.rs'
@ -57,7 +59,6 @@ jobs:
name: Build and Deploy Zebra Book Docs
timeout-minutes: 5
runs-on: ubuntu-latest
environment: docs
permissions:
checks: write
contents: 'read'
@ -91,24 +92,24 @@ jobs:
service_account: '${{ vars.GCP_FIREBASE_SA }}'
# TODO: remove this step after issue https://github.com/FirebaseExtended/action-hosting-deploy/issues/174 is fixed
- run: |
- name: Add $GCP_FIREBASE_SA_PATH to env
run: |
# shellcheck disable=SC2002
echo "GCP_FIREBASE_SA=$(cat ${{ steps.auth.outputs.credentials_file_path }} | tr -d '\n')" >> "$GITHUB_ENV"
echo "GCP_FIREBASE_SA_PATH=$(cat ${{ steps.auth.outputs.credentials_file_path }} | tr -d '\n')" >> "$GITHUB_ENV"
- name: Deploy Zebra book to firebase
uses: FirebaseExtended/action-hosting-deploy@v0.7.1
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ env.GCP_FIREBASE_SA }}
firebaseServiceAccount: ${{ env.GCP_FIREBASE_SA_PATH }}
channelId: ${{ env.FIREBASE_CHANNEL }}
projectId: ${{ vars.GCP_PROJECT }}
projectId: ${{ vars.GCP_FIREBASE_PROJECT }}
target: docs-book
build-docs-external:
name: Build and Deploy Zebra External Docs
timeout-minutes: 45
runs-on: ubuntu-latest
environment: docs
permissions:
checks: write
contents: 'read'
@ -136,7 +137,7 @@ jobs:
- name: Build external docs
run: |
# Exclude zebra-utils, it is not for library or app users
cargo doc --no-deps --workspace --all-features --exclude zebra-utils --target-dir target/external
cargo doc --no-deps --workspace --all-features --exclude zebra-utils --target-dir "$(pwd)"/target/external
env:
RUSTDOCFLAGS: '--html-in-header katex-header.html'
@ -150,24 +151,24 @@ jobs:
service_account: '${{ vars.GCP_FIREBASE_SA }}'
# TODO: remove this step after issue https://github.com/FirebaseExtended/action-hosting-deploy/issues/174 is fixed
- run: |
- name: Add $GCP_FIREBASE_SA_PATH to env
run: |
# shellcheck disable=SC2002
echo "GCP_FIREBASE_SA=$(cat ${{ steps.auth.outputs.credentials_file_path }} | tr -d '\n')" >> "$GITHUB_ENV"
echo "GCP_FIREBASE_SA_PATH=$(cat ${{ steps.auth.outputs.credentials_file_path }} | tr -d '\n')" >> "$GITHUB_ENV"
- name: Deploy external docs to firebase
uses: FirebaseExtended/action-hosting-deploy@v0.7.1
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ env.GCP_FIREBASE_SA }}
firebaseServiceAccount: ${{ env.GCP_FIREBASE_SA_PATH }}
channelId: ${{ env.FIREBASE_CHANNEL }}
target: docs-external
projectId: ${{ vars.GCP_PROJECT }}
projectId: ${{ vars.GCP_FIREBASE_PROJECT }}
build-docs-internal:
name: Build and Deploy Zebra Internal Docs
timeout-minutes: 45
runs-on: ubuntu-latest
environment: docs
permissions:
checks: write
contents: 'read'
@ -194,7 +195,7 @@ jobs:
- name: Build internal docs
run: |
cargo doc --no-deps --workspace --all-features --document-private-items --target-dir target/internal
cargo doc --no-deps --workspace --all-features --document-private-items --target-dir "$(pwd)"/target/internal
env:
RUSTDOCFLAGS: '--html-in-header katex-header.html'
@ -208,15 +209,16 @@ jobs:
service_account: '${{ vars.GCP_FIREBASE_SA }}'
# TODO: remove this step after issue https://github.com/FirebaseExtended/action-hosting-deploy/issues/174 is fixed
- run: |
- name: Add $GCP_FIREBASE_SA_PATH to env
run: |
# shellcheck disable=SC2002
echo "GCP_FIREBASE_SA=$(cat ${{ steps.auth.outputs.credentials_file_path }} | tr -d '\n')" >> "$GITHUB_ENV"
echo "GCP_FIREBASE_SA_PATH=$(cat ${{ steps.auth.outputs.credentials_file_path }} | tr -d '\n')" >> "$GITHUB_ENV"
- name: Deploy internal docs to firebase
uses: FirebaseExtended/action-hosting-deploy@v0.7.1
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ env.GCP_FIREBASE_SA }}
firebaseServiceAccount: ${{ env.GCP_FIREBASE_SA_PATH }}
channelId: ${{ env.FIREBASE_CHANNEL }}
target: docs-internal
projectId: ${{ vars.GCP_PROJECT }}
projectId: ${{ vars.GCP_FIREBASE_PROJECT }}

View File

@ -1,7 +1,7 @@
{
"hosting": [
{
"public": "target/external",
"public": "target/external/doc",
"target": "docs-external",
"ignore": [
"firebase.json",
@ -23,7 +23,7 @@
]
},
{
"public": "target/internal",
"public": "target/internal/doc",
"target": "docs-internal",
"ignore": [
"firebase.json",