Skip to content

Commit

Permalink
build: add pipeline ⛏️
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayakkulkarni committed Mar 9, 2024
1 parent 277bb52 commit ba4ee54
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 33 deletions.
42 changes: 12 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,38 @@
name: 'Continuous Integration'

on:
push:
branches:
- main
- dev
pull_request_target:
branches:
- main
- dev
workflow_call:

permissions:
checks: write
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Check out repository ✨
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'pull_request_target' && github.actor != 'dependabot[bot]' }}
- name: Check out repository ✨ (non dependabot)
if: ${{ github.actor != 'dependabot[bot]' }}
uses: actions/checkout@v4

- name: Check out repository 🎉 (dependabot)
if: ${{ github.event_name == 'pull_request_target' }}
if: ${{ github.actor == 'dependabot[bot]' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup node env 📦
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
check-latest: true
cache: 'npm'

- name: Install dependencies 🚀
run: npm ci --prefer-offline --no-audit --unsafe-perm=true
run: npm ci --prefer-offline --no-audit

- name: Run linter(s) 👀
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
continue_on_error: false
git_name: github-actions[bot]
git_email: github-actions[bot]@users.noreply.github.com
auto_fix: false
stylelint: true
eslint: true
eslint_extensions: js,ts,vue
prettier: true
prettier_extensions: js,ts,vue
neutral_check_on_warning: true
run: npm run lint

- name: Run build 🏁
run: npm run generate
run: npm run build
31 changes: 31 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'The Pipeline'

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

concurrency:
group: ci-${{ github.ref }}-1
cancel-in-progress: true

jobs:
extract-branch:
name: 'Fetch branch'
runs-on: ubuntu-latest
outputs:
current_branch: ${{ steps.get-branch.outputs.current_branch }}
steps:
- name: Extract branch name 🕊
id: get-branch
run: echo "current_branch=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
ci:
needs:
- extract-branch
name: 'CI'
uses: ./.github/workflows/ci.yml
7 changes: 5 additions & 2 deletions .github/workflows/shipjs-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
types:
- closed

permissions:
contents: write

jobs:
build:
name: Release
Expand All @@ -30,11 +33,11 @@ jobs:
cache: 'npm'

- name: Install dependencies 🚀
run: npm ci --prefer-offline --no-audit --omit=optional
run: npm ci --prefer-offline --no-audit

- name: Trigger a release 🥳
run: npx shipjs trigger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
2 changes: 1 addition & 1 deletion ship.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
installCommand: () => 'npm i --prefer-offline --no-audit --omit=optional',
installCommand: () => 'npm i --prefer-offline --no-audit',
buildCommand: () => null,
publishCommand: ({ tag }) =>
`echo "Releasing ${tag} version of Expenses frontend webapp"`,
Expand Down

0 comments on commit ba4ee54

Please sign in to comment.