Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created Sep 16, 2022
Embed
What would you like to do?
# ci.yml
name: CI
env:
# Branching
is-merge: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
is-pull-request: ${{ github.event_name == 'pull_request' }}
NODE_OPTIONS: --max-old-space-size=6144
on:
push:
branches:
- main
pull_request: {}
jobs:
builds:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v3
with:
# Required by nrwl/nx-set-shas
fetch-depth: 0
- name:
'Derive appropriate SHAs for base and head for `nx affected` commands'
uses: nrwl/nx-set-shas@v2
- name: Set up dependencies
uses: ./.github/actions/setup-dependencies
- name: 'PR: Build application if affected by changes in feature branch'
if: env.is-pull-request == 'true'
run: yarn affected:build
- name: 'Merge: Build application'
if: env.is-merge == 'true'
run: yarn build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment