Skip to content

Commit

Permalink
feat(ci): add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ergenekonyigit committed Sep 6, 2022
1 parent e763168 commit db514bf
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: Publish Docs

on:
push:
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Verify and Preview

on:
pull_request:
branches:
- main

permissions:
pull-requests: read

jobs:
verify:
uses: ./.github/workflows/verify.yml
secrets: inherit
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
workflow_call:
secrets:
TRENDYOL_JS_NPM_TOKEN:
required: true

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Node env
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Run build
run: npm run build
- name: Create build artifact
uses: actions/upload-artifact@master
with:
name: build-output
path: lib/
- name: Publish
run: npx semantic-release
env:
TRENDYOL_JS_NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/verify-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Verify and Release'

on:
push:
branches:
- main

jobs:
verify:
uses: ./.github/workflows/verify.yml
secrets: inherit
publish:
uses: ./.github/workflows/publish-docs.yml
needs: verify
secrets: inherit
release:
uses: ./.github/workflows/release.yml
needs: verify
secrets: inherit
27 changes: 27 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Verify

on:
workflow_call:

jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set Node env
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter check
run: npm run lint
- name: Run tests
run: npm run test
- name: Create coverage artifact
uses: actions/upload-artifact@master
with:
name: coverage-output
path: coverage/

0 comments on commit db514bf

Please sign in to comment.