Skip to content

Commit

Permalink
feat: add cd workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentHardouin committed Mar 5, 2024
1 parent 950c1ff commit b3e0e0e
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: cd

on:
push:
branches:
- main
repository_dispatch:
types: [ 'deploy' ]
workflow_dispatch:

jobs:
cd:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-file: 'package.json'

- name: Install
run: npm ci

- name: Test
run: npm test

- name: Build
run: npm run build

- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 23
extra_plugins: |
@semantic-release/changelog@6
@semantic-release/git@10
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
cname: metro-travel.vincenthardouin.dev
27 changes: 27 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "docs/CHANGELOG.md"
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"package-lock.json",
"docs/CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}

0 comments on commit b3e0e0e

Please sign in to comment.