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

Commit 5d06f88

Browse files
chore(merge): merge chore branch 'chore/setup-deployment-environment'.
* 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.
1 parent 0b8f1b9 commit 5d06f88

File tree

7 files changed

+8313
-2385
lines changed

7 files changed

+8313
-2385
lines changed

.github/workflows/deploy.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: deploy to production.
2+
env:
3+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
5+
on:
6+
release:
7+
types: [published]
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: install Vercel CLI.
14+
run: npm install --global vercel@latest
15+
- name: pull Vercel environment information.
16+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
17+
- name: build project artifacts.
18+
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
19+
- name: deploy project artifacts to Vercel.
20+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
release:
12+
env:
13+
HUSKY: 0
14+
name: release
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
issues: write
19+
steps:
20+
- name: checkout code.
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- name: setup Node.js.
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: "20.12.0"
28+
- name: install dependencies.
29+
run: npm ci
30+
- name: publish release.
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: npx semantic-release

.husky/install.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Skip Husky install in production and CI
2+
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
3+
process.exit(0)
4+
}
5+
const husky = (await import('husky')).default
6+
console.log(husky())

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run lint

.releaserc.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
{
6+
"preset": "angular",
7+
"releaseRules": [
8+
{"type": "feat", "release": "minor"},
9+
{"type": "fix", "release": "patch"},
10+
{"type": "chore", "release": false}
11+
],
12+
"parserOpts": {
13+
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
14+
}
15+
},
16+
"@semantic-release/release-notes-generator",
17+
"@semantic-release/changelog",
18+
{
19+
"changelogFile": "docs/CHANGELOG.md",
20+
"changelogTitle": "# Changelog"
21+
},
22+
"@semantic-release/github",
23+
{
24+
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
25+
"message": "chore(release): 🚀 ${nextRelease.version}. [skip ci]"
26+
},
27+
"@semantic-release/npm",
28+
{
29+
"npmPublish": false
30+
},
31+
"@semantic-release/git"
32+
],
33+
"repositoryUrl": "https://github.com/mango-habanero/gallery.git"
34+
}

0 commit comments

Comments
 (0)