Skip to content

Commit

Permalink
Merge pull request #6 from bbonkr/dev
Browse files Browse the repository at this point in the history
Add github actions
  • Loading branch information
bbonkr authored Sep 10, 2021
2 parents b63cfbb + 0b01539 commit 84219c5
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
labels:
- 'chore'
- 'doc'
- 'documentation'
- 'modifications'
- 'maintenance'
- 'refactoring'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
exclude-labels:
- 'skip-changelog'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
$CHANGES
53 changes: 53 additions & 0 deletions .github/workflows/build-and-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and tag

on:
push:
branches:
- main # Default release branch
tags:
- "!*"

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: install dependencies
run: npm install
- name: lint
run: npm run lint
- name: build
env:
NODE_ENV: production
run: npm run build

- name: get version
id: get_package_version
run: echo "::set-output name=version::$(node -p -e "require('./package.json').version")"
- name: set version
run: echo "PACKAGE_VERSION=${{ steps.get_package_version.outputs.version }}" >> $GITHUB_ENV

- name: package-version-to-git-tag
uses: pkgdeps/git-tag-action@v2
with:
github_token: ${{ secrets.GH_TOKEN }}
github_repo: ${{ github.repository }}
version: ${{ env.PACKAGE_VERSION }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"
- name: Release Drafter
id: release_drafter
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
version: ${{ env.PACKAGE_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/publish-gh-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: publish gh-pages

on:
push:
tags:
- 'v*'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1 # Fetch all history for .GitInfo and .Lastmod

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: npm install

- name: Build
run: npm run build
env:
NODE_ENV: production

- name: Prepare tag
id: prepare_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME="${GITHUB_REF##refs/tags/}"
echo "::set-output name=tag_name::${TAG_NAME}"
echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}"
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_branch: gh-pages
publish_dir: ./out
tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'

0 comments on commit 84219c5

Please sign in to comment.