Skip to content

Commit

Permalink
build: update .github workflow(s)
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
  • Loading branch information
vinayakkulkarni committed Nov 1, 2022
1 parent 9010d10 commit 407eec9
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 87 deletions.
20 changes: 15 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Fetch and update latest `npm` packages
Expand All @@ -20,6 +15,21 @@ updates:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `npm` packages
- package-ecosystem: npm
directory: '/example'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- vinayakkulkarni
assignees:
- vinayakkulkarni
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: '/'
Expand Down
5 changes: 0 additions & 5 deletions .github/semantic.yml

This file was deleted.

40 changes: 11 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,42 @@
name: ci
name: 'Continuous Integration'

on:
push:
branches:
- main
- next
pull_request_target:
- legacy
pull_request:
branches:
- main
- next
- legacy

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: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [16]

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

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

- name: Setup node env πŸ“¦
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
node-version: 'current'
check-latest: true
registry-url: https://registry.npmjs.org
cache: 'npm'

- name: Upgrade npm πŸŽ‰
run: npm install -g npm@latest
cache: 'npm'

- name: Install dependencies πŸš€
run: npm ci --prefer-offline --no-audit --no-optional
run: npm ci --prefer-offline --no-audit --omit=optional

- name: Run linter(s) πŸ‘€
uses: wearerequired/lint-action@v2
Expand All @@ -69,8 +54,5 @@ jobs:
prettier: true
prettier_extensions: js,ts,vue

- name: Run tests 🏁
run: npm test

- name: Build the package πŸŽ‰
run: npm run build
39 changes: 39 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Deploy to Pages'

on:
push:
branches:
- main

jobs:
deploy-demo:
runs-on: ubuntu-latest
defaults:
run:
working-directory: './example/'
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Setup node env πŸ“¦
uses: actions/setup-node@v3
with:
node-version: 'current'
check-latest: true
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies πŸš€
run: npm ci --prefer-offline --no-audit --omit=optional

- name: Run build 🏁
run: npm run build

- name: Deploy to GitHub Pages πŸš€
uses: peaceiris/actions-gh-pages@v3.9.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./example/dist
cname: v-image.netlify.app
38 changes: 0 additions & 38 deletions .github/workflows/deploy-gh.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Lint PR'

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
validate-pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

check-sign-off:
if: startsWith(github.head_ref, 'releases/v') == false
name: Write comment if unsigned commits found
env:
FORCE_COLOR: 1
runs-on: ubuntu-latest
steps:
- uses: live627/check-pr-signoff-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
16 changes: 6 additions & 10 deletions .github/workflows/shipjs-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,23 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')
steps:
- name: Checkout πŸ›ŽοΈ
- name: Checkout code πŸ›Ž
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main

- name: Setup node env πŸ“¦
- name: Setup node environment πŸ“¦
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 'current'
check-latest: true
registry-url: https://registry.npmjs.org
cache: 'npm'

- name: Upgrade npm πŸŽ‰
run: npm install -g npm@latest
- name: Install dependencies πŸš€
run: npm ci --prefer-offline --no-audit --omit=optional

- name: Install dependencies πŸ‘¨πŸ»β€πŸ’»
run: npm ci --prefer-offline --no-audit

- name: Perform a new release 🚨
- name: Trigger a release πŸ₯³
run: npx shipjs trigger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 407eec9

Please sign in to comment.