Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
chore(merge): merge chore branch 'chore/setup-deployment-environment'.
Browse files Browse the repository at this point in the history
* build(npm): adds semantic release package.

* build(npm): adds semantic release plugins.

* feat(config): adds configuration for semantic release for use in CI.

* fix(config): restricts release config application to main branch.

* build(npm): adds husky package.

* style(cql): Implements husky for pre-commit hooks.

* ci(GitHubActions): Adds workflows to automate application version and deployment.

- Implements a release workflow.
- Implements a deployment workflow triggered by new releases.
  • Loading branch information
mango-habanero authored Jun 27, 2024
1 parent 0b8f1b9 commit 5d06f88
Show file tree
Hide file tree
Showing 7 changed files with 8,313 additions and 2,385 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: deploy to production.
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install Vercel CLI.
run: npm install --global vercel@latest
- name: pull Vercel environment information.
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: build project artifacts.
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: deploy project artifacts to Vercel.
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release
on:
push:
branches:
- main

permissions:
contents: read

jobs:
release:
env:
HUSKY: 0
name: release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
steps:
- name: checkout code.
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup Node.js.
uses: actions/setup-node@v3
with:
node-version: "20.12.0"
- name: install dependencies.
run: npm ci
- name: publish release.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
6 changes: 6 additions & 0 deletions .husky/install.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Skip Husky install in production and CI
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
process.exit(0)
}
const husky = (await import('husky')).default
console.log(husky())
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint
34 changes: 34 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{"type": "feat", "release": "minor"},
{"type": "fix", "release": "patch"},
{"type": "chore", "release": false}
],
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
}
},
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
{
"changelogFile": "docs/CHANGELOG.md",
"changelogTitle": "# Changelog"
},
"@semantic-release/github",
{
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
"message": "chore(release): 🚀 ${nextRelease.version}. [skip ci]"
},
"@semantic-release/npm",
{
"npmPublish": false
},
"@semantic-release/git"
],
"repositoryUrl": "https://github.com/mango-habanero/gallery.git"
}
Loading

0 comments on commit 5d06f88

Please sign in to comment.