Skip to content

Commit

Permalink
ci: add initial workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Jakob Steiner <[email protected]>
  • Loading branch information
kosmoz committed Feb 28, 2024
1 parent 340c5e4 commit 894e420
Show file tree
Hide file tree
Showing 5 changed files with 2,206 additions and 35 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
push:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Setup node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: "20"
cache: npm
- name: Install dependencies
run: npm ci
- name: Check formatting with prettier
run: npm run prettier:check
- name: Build application
run: npm run build
22 changes: 22 additions & 0 deletions .github/workflows/commit-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check commit message format

on:
pull_request:

jobs:
commit-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Setup node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: '20'
cache: npm
- name: Install dependencies
run: npm ci
- name: Validate commits
run: |
npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
54 changes: 54 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Update Changelog & Release

on:
push:
branches:
- main
workflow_dispatch:

jobs:
release-please:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Release Please
id: release-please
uses: google-github-actions/release-please-action@cc61a07e2da466bebbc19b3a7dd01d6aecb20d1e # v4.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}

publish:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
needs:
- release-please
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Setup node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: "20"
cache: npm
registry-url: "https://npm.pkg.github.com"
scope: "@glasskube"
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 894e420

Please sign in to comment.