Deploy Docs #44
This file contains hidden or 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: Deploy Docs | |
| on: | |
| workflow_dispatch: | |
| env: | |
| NODE_VERSION: 22 | |
| jobs: | |
| deploy: | |
| name: Deploy Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out a copy of the repo | |
| uses: actions/checkout@v4 | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v3 | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| cache: 'pnpm' | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| # - name: Set Version Path | |
| # run: echo "ADDON_DOCS_VERSION_PATH=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
| - name: Set Latest | |
| run: echo "ADDON_DOCS_UPDATE_LATEST=true" >> $GITHUB_ENV | |
| - name: Print Env | |
| run: echo $GITHUB_ENV | |
| - name: Build docs | |
| run: pnpm run build | |
| working-directory: 'docs' | |
| - name: Deploy | |
| env: | |
| # Transport the key base64-encoded (DOCS_DEPLOY_KEY_B64) to survive | |
| # newline trimming / CRLF mangling. Decode it to a file and hand | |
| # ember-cli-deploy-git-ci the PATH (DEPLOY_KEY_PATH -> deployKeyPath in | |
| # config/deploy.js), never the key value itself. ember-cli-deploy logs | |
| # config values under --verbose, so passing the key as a value (the | |
| # `deployKey`/DEPLOY_KEY default) would print the private key into the | |
| # logs. The matching public key is a write-enabled Deploy Key on | |
| # jkeen/ember-stereo. | |
| DOCS_DEPLOY_KEY_B64: ${{ secrets.DOCS_DEPLOY_KEY_B64 }} | |
| run: | | |
| set -euo pipefail | |
| KEY_FILE="$RUNNER_TEMP/docs_deploy_key" | |
| printf '%s' "$DOCS_DEPLOY_KEY_B64" | base64 -d | tr -d '\r' > "$KEY_FILE" | |
| chmod 600 "$KEY_FILE" | |
| export DEPLOY_KEY_PATH="$KEY_FILE" | |
| pnpm exec ember deploy production --activate | |
| working-directory: 'docs' |