-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
347b52c
commit e7da488
Showing
1 changed file
with
44 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: 'setup-nx' | ||
description: 'setup-nx' | ||
inputs: | ||
ro-token: | ||
description: 'the github token to use GitHub API' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Add tools path | ||
shell: bash | ||
run: | | ||
mkdir -p "~/.local/bin" | ||
echo "~/.local/bin" >> $GITHUB_PATH | ||
- name: Git config | ||
shell: bash | ||
run: | | ||
git config --global url."https://${{ inputs.ro-token }}:[email protected]/".insteadOf "https://github.com/" | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
# Setup yarn | ||
- uses: volta-cli/action@v4 | ||
- name: Print node/yarn versions | ||
id: versions | ||
shell: bash | ||
run: | | ||
node_ver=$( node --version ) | ||
yarn_ver=$( yarn --version || true ) | ||
echo "Node: ${node_ver:1}" | ||
if [[ $yarn_ver != '' ]]; then echo "Yarn: $yarn_ver"; fi | ||
echo "node_version=${node_ver:1}" >> $GITHUB_OUTPUT | ||
- name: Use the node_modules cache if available | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-yarn- | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
yarn install --immutable |