-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
seperated version workflow from deployment
- Loading branch information
1 parent
bfaf0af
commit 8b329a6
Showing
2 changed files
with
37 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🛒 Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🏗️ Set up Node.js v18.20.4 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.20.4 | ||
|
||
- name: 🛠️ Install and Build | ||
run: | | ||
npm ci | ||
npm run build | ||
- name: 🚀 Deploy | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: dist | ||
branch: gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,81 +14,55 @@ on: | |
branches: | ||
- "master" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
createTag: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
- name: 🛒 Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: master | ||
|
||
- name: Set up Node.js v18.20.4 | ||
- name: 🏗️ Set up Node.js v18.20.4 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.20.4 | ||
|
||
- name: Check Node Dependencies | ||
- name: ✅ Check Node Dependencies | ||
run: npm install | ||
|
||
- name: Set up Git | ||
- name: 🏗️ Set up Git | ||
run: | | ||
git config user.name "Github Action" | ||
git config user.email "[email protected]" | ||
- name: Determine Version Bump based on Inputs | ||
- name: 🔍 Determine Version Bump based on Inputs | ||
id: determine_version | ||
run: | | ||
VERSION_TYPE="${{ github.event.inputs.version || 'patch' }}" | ||
echo "Version bump type: $VERSION_TYPE" | ||
echo "bump_type=$VERSION_TYPE" >> $GITHUB_ENV | ||
- name: Update the version | ||
- name: 🔄 Update the version | ||
id: update_version | ||
run: | | ||
VERSION_TYPE="${{ env.bump_type }}" | ||
echo "Bumping version as $VERSION_TYPE" | ||
echo "version=$(npm version $VERSION_TYPE --no-git-tag-version)" >> $GITHUB_OUTPUT | ||
- name: Commit all changes | ||
- name: ✔️ Commit all changes | ||
run: | | ||
git add -A # Add all changes, including unmodified files from development | ||
git commit -m "Bump version to ${{ steps.update_version.outputs.version }}" | ||
- name: Push the version bump | ||
- name: 📤 Push the version bump | ||
run: | | ||
git push | ||
- name: Create and push git tag | ||
- name: 🏷️ Create and push git tag | ||
run: | | ||
next_version=${{ steps.update_version.outputs.version }} | ||
git tag -a "$next_version" -m "Version $next_version" | ||
git push --follow-tags | ||
deploy: | ||
concurrency: ci-${{ github.ref }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js v18.20.4 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.20.4 | ||
|
||
- name: Install and Build | ||
run: | | ||
npm ci | ||
npm run build | ||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: dist | ||
branch: gh-pages |