build(deps): bump actions/setup-node from 4.0.1 to 4.0.2 #107
Workflow file for this run
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
name: Deploy Preview | |
on: | |
# push: | |
# branches-ignore: | |
# - main | |
pull_request: | |
branches-ignore: | |
- 'dependabot/**' | |
# https://github.com/orgs/community/discussions/26681 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
if: github.repository_owner == 'inventage' && !contains('dependabot', github.ref) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version: '18' | |
# @see https://www.voorhoede.nl/en/blog/super-fast-npm-install-on-github-actions/ | |
- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 | |
id: cache | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Install packages | |
if: steps.cache.outputs.cache-hit != 'true' | |
env: | |
HUSKY_SKIP_HOOKS: 1 | |
run: npm ci | |
- name: Run postinstall | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: npm run --if-present postinstall && npm rebuild && npm run prepare --if-present | |
- name: Storybook Build | |
run: npm run storybook:build | |
- uses: gacts/github-slug@ee992367ac8f20b63d223a84858cc8e4d6842382 # v1.3.0 | |
id: slug | |
- run: | | |
echo "BRANCH_NAME_SLUG=${{ steps.slug.outputs.branch-name-slug }}" >> $GITHUB_ENV | |
echo "DEPLOY_URL=https://${{ steps.slug.outputs.branch-name-slug }}--inventage-web-components.netlify.app" >> $GITHUB_ENV | |
echo "GITHUB_SHA_SHORT=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV | |
# Use netlify-cli directly, since it is installed in the latest ubuntu runner | |
# @see https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#cli-tools | |
# @see https://cli.netlify.com/commands/deploy/ | |
- name: Deploy | |
id: deploy | |
run: | | |
mv package.json _package.json && \ | |
netlify deploy \ | |
--alias ${{ env.BRANCH_NAME_SLUG }} \ | |
--build false \ | |
--dir storybook-static \ | |
--message 'Preview deployment for ${{ steps.slug.outputs.branch-name }} (${{ env.GITHUB_SHA_SHORT }})' \ | |
--prod false \ | |
--json true | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
# Creates a status check with link to preview | |
- name: Status check | |
uses: Sibz/github-status-action@650dd1a882a76dbbbc4576fb5974b8d22f29847f # v1.1.6 | |
with: | |
authToken: ${{ secrets.GITHUB_TOKEN }} | |
context: Deployment | |
description: Deployed preview to Netlify | |
state: success | |
target_url: ${{ env.DEPLOY_URL }} | |
- name: Comment PR | |
uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308 # v2.4.3 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
message: | | |
Deployed to ${{ env.DEPLOY_URL }} | |
comment_tag: deployment |