mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-03-21 07:44:03 +00:00
To avoid burning Azure credits, we move the runners back down to the free tier. Now that caching is properly set up, this should incur only a minor increase in CI time.
36 lines
1.1 KiB
YAML
36 lines
1.1 KiB
YAML
name: "Setup Node"
|
|
description: "Sets up the correct Node version and installs pnpm"
|
|
inputs:
|
|
lockfile-dir:
|
|
description: "Path to the pnpm-lock.yaml file"
|
|
required: true
|
|
npmjs-token:
|
|
description: "NPMJS token to use for authentication"
|
|
required: true
|
|
node-version:
|
|
description: "Version of nodejs to install"
|
|
required: false
|
|
default: "20"
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Configure npm auth
|
|
shell: bash
|
|
run: |
|
|
if [[ -z "${{ inputs.npmjs-token }}" ]]; then
|
|
echo "inputs.npmjs-token not provided" >&2
|
|
exit 1
|
|
fi
|
|
cat > "$HOME/.npmrc" <<'RC'
|
|
always-auth=true
|
|
//registry.npmjs.org/:_authToken=${{ inputs.npmjs-token }}
|
|
RC
|
|
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
|
|
with:
|
|
version: latest
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
node-version: ${{ inputs.node-version }}
|
|
cache: pnpm
|
|
cache-dependency-path: ${{ inputs.lockfile-dir }}
|