fix: pipe condition #2
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: Development Pipeline | |
on: | |
push: | |
branches: | |
- develop | |
concurrency: | |
group: ${{ github.event.repository.name }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Cache Yarn packages | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
yarn config set cacheFolder ./.yarn/cache | |
yarn install --frozen-lockfile | |
lint: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Lint code | |
run: yarn run lint | |
test: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Test Dependencies | |
run: yarn add --dev jest-junit | |
- name: Run unit tests | |
run: yarn test --ci --reporters=default --reporters=jest-junit | |
- name: Upload test artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-results | |
path: junit.xml | |
build: | |
needs: [lint, test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Docker login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build application | |
run: yarn build:docker |