Skip to content

feat(additionalEnquiry) #64

feat(additionalEnquiry)

feat(additionalEnquiry) #64

Workflow file for this run

name: FE build action
on:
pull_request:
branches:
- 'develop'
push:
branches:
- '**'
tags-ignore:
- 'dockerImage.v.*'
jobs:
build:
name: Build & Release
if: "!contains(github.event.head_commit.author, '[email protected]') && (github.event_name != 'pull_request' || github.event.pull_request == null)"
permissions:
checks: write
runs-on: ubuntu-latest
steps:
- name: set env
run: |
echo BRANCH=$(echo -n "${GITHUB_REF#refs/heads/}") >> $GITHUB_ENV
if [ "${{ github.ref }}" = "refs/heads/staging" ]; then
echo ENV_NAME="staging" >> $GITHUB_ENV
else
echo ENV_NAME="prod" >> $GITHUB_ENV
fi
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Load .env file
uses: xom9ikk/dotenv@v2
with:
mode: ${{ env.ENV_NAME }}
- run: npm ci
- name: Run linters
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.github_token }}
eslint: true
eslint_dir: ./src
eslint_extensions: js,ts,tsx
stylelint: true
stylelint_dir: ./src
stylelint_extensions: scss
prettier: true
- name: Run build
run: |
npm run build
- name: Run tests
run: |
echo "127.0.0.1 localhost" | sudo tee -a /etc/hosts
echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf
npm run test:build
- name: Bump version
if: env.BRANCH == 'release'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
npm run release
- name: Push changes
if: env.BRANCH == 'release'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{env.BRANCH}}
force: true
tags: true
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
path: cypress/videos/