Header responsiveness and content alignment fix #21
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: ESLint Check | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [main] | |
types: [opened, synchronize, reopened] | |
permissions: | |
pull-requests: write | |
contents: write | |
jobs: | |
lint-and-deploy: | |
name: Run ESLint check and deploy Preview | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: setup NodeJS for Build | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
- name: install all Dependencies | |
run: npm ci | |
- name: Run security audit | |
run: npm audit | |
continue-on-error: true | |
id: security-audit | |
- name: Check for security vulnerabilities | |
if: steps.security-audit.outcome == 'failure' | |
run: | | |
echo "Security vulnerabilities found. Failing the workflow." | |
exit 1 | |
- name: Run ESLint test | |
run: npm run lint:strict | |
continue-on-error: true | |
id: eslint | |
- name: block PR if ESLint fails | |
continue-on-error: true | |
if: steps.eslint.outcome == 'failure' | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ github.tokens }} | |
script: | | |
github.rest.pulls.createReview({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.issue.number, | |
event: 'REQUEST_CHANGES', | |
body: 'ESLint check failed. Please fix all linting issues (including warnings) before merging.' | |
}) | |
- name: check for ESLint result | |
if: steps.eslint.outcome == 'failure' | |
run: | | |
echo "ESLint found issues. Failing the workflow." | |
exit 1 | |
- name: build Project from React Files | |
run: npm run build | |
- name: create _redirects file | |
run: echo "/healthcare/* /index.html 200" > build/_redirects | |
- name: deploy to netlify | |
continue-on-error: true | |
id: netlify-deploy | |
uses: nwtgck/[email protected] | |
with: | |
publish-dir: './build' | |
production-branch: main | |
github-token: ${{ secrets.VAI }} # GITHUB_TOKEN and VAI throwing resource-inaccessible error | |
deploy-message: "FROM GITHUB_ACTIONS" | |
enable-pull-request-comment: true | |
enable-commit-comment: false | |
overwrites-pull-request-comment: false | |
alias: healthcare-deploy-preview-${{ github.event.number }} | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
timeout-minutes: 1 | |
# - name: Comment URL preview on PR | |
# continue-on-error: true | |
# uses: actions/github-script@v7 | |
# with: | |
# script: | | |
# const deployUrl = '${{ steps.netlify-deploy.outputs.deploy-url }}'; | |
# const issueNumber = context.issue.number; | |
# const username = context.actor; | |
# if (deployUrl) { | |
# github.rest.issues.createComment({ | |
# issue_number: issueNumber, | |
# owner: context.repo.owner, | |
# repo: context.repo.repo, | |
# body: `WORKFLOW BOT: @${username} your preview URL has been generated: ${deployUrl}` | |
# }); | |
# } else { | |
# github.rest.issues.createComment({ | |
# issue_number: issueNumber, | |
# owner: context.repo.owner, | |
# repo: context.repo.repo, | |
# body: `WORKFLOW BOT: @${username} your preview URL not deployed` | |
# }); | |
# } |