chore(deps): update dependency @types/react to v18.3.10 #1521
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: Build and Deploy | |
on: push | |
env: | |
CI: true | |
NODE_VER: 20 | |
NETLIFY_SITE_ID: 89194942-bd48-4c23-a181-7e489c17eabc | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VER }} | |
- uses: bahmutov/npm-install@v1 | |
- name: prettier | |
run: npx prettier '**/*.{js?(on|x),ts?(x),y?(a)ml,graphql,md,css}' --check | |
- name: typescript | |
run: npx tsc --noEmit | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VER }} | |
- uses: bahmutov/npm-install@v1 | |
- name: build | |
run: npm run build | |
- name: build package | |
run: npm version --no-git-tag-version 0.0.0-${{ github.sha }} && npm pack | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: dist | |
- name: Upload package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: react-image-0.0.0-${{ github.sha }}.tgz | |
path: react-image-0.0.0-${{ github.sha }}.tgz | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VER }} | |
- uses: bahmutov/npm-install@v1 | |
- name: test | |
run: npm test | |
- name: download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build | |
path: dist | |
- name: test built libs | |
run: npm run test:dist | |
- name: Setup env vars | |
run: | | |
printf -v SHORT_COMMIT_MESSAGE '%q ' `git log --oneline -n 1 HEAD --format=%B` | |
echo "GIT_SHORT_COMMIT_MESSAGE=$SHORT_COMMIT_MESSAGE" | tee -a $GITHUB_ENV | |
echo "GIT_SHORT_REVISION=$(echo ${GITHUB_SHA} | cut -c1-7)" | tee -a $GITHUB_ENV | |
- name: Deploy visual tests to Netlify | |
uses: nwtgck/actions-netlify@v3 | |
id: deploy-to-netlify | |
with: | |
publish-dir: dist/dev | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: '[${{ github.ref_name }}@${{ env.GIT_SHORT_REVISION }}] ${{ env.GIT_SHORT_COMMIT_MESSAGE }}' | |
enable-pull-request-comment: false | |
enable-commit-comment: false | |
enable-commit-status: false | |
# Use custom alias for non master branch Deploy Previews only | |
alias: ${{ github.ref_name != 'master' && env.RUN_NAME || '' }} | |
github-deployment-environment: '[${{ github.ref_name }}] visual tests' | |
fails-without-credentials: true | |
production-deploy: ${{ github.ref_name == 'master' }} | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ env.NETLIFY_SITE_ID }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [lint, test] | |
if: ${{ github.ref_name == 'master' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VER }} | |
- uses: bahmutov/npm-install@v1 | |
- name: setup .npmrc | |
run: npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
- name: download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build | |
path: dist | |
- name: check if package is newer than the published version | |
id: checkPublish | |
run: echo "::set-output name=shouldPublish::`npm run -s isNewerThanPublished`" | |
- name: publish release package if needed | |
if: steps.checkPublish.outputs.shouldPublish == 'true' | |
run: npm publish |