Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: integrate semantic release and deploying to github pages #50

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Production Release

on:
push:
branches:
- master

jobs:
build-deploy-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Dependencies
run: npm install

- name: Build Frontend
run: nx build frontend --prod --base-href https://vv.danieljancar.dev/

- name: Create CNAME
run: echo "vv.danieljancar.dev" > dist/apps/frontend/CNAME

- name: Configure Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "gh-actions[bot]"

- name: Deploy to GitHub Pages
run: |
git init
git checkout --orphan gh-pages
git --work-tree dist/apps/frontend add --all
git --work-tree dist/apps/frontend commit -m 'Deploy'
git push -f origin gh-pages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Semantic Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"branches": ["master"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "package.json", "package-lock.json"],
"message": "chore(release): ${nextRelease.version}"
}
]
],
"npmPublish": false
}
4 changes: 2 additions & 2 deletions apps/frontend/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
"maximumWarning": "2mb",
"maximumError": "4mb"
},
{
"type": "anyComponentStyle",
Expand Down
Loading