-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5dc1eb
commit b5f536f
Showing
3 changed files
with
21 additions
and
98 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
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
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 |
---|---|---|
@@ -1,77 +1,24 @@ | ||
name: GitFlow Release | ||
name: Release and Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
release: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: Production | ||
url: "https://brdgm.me/${{ steps.package_json.outputs.appDeployName }}" | ||
url: "https://brdgm.me/${{ steps.release.outputs.app-deploy-name }}" | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
|
||
- run: npm ci | ||
- run: npm run test:unit | ||
- run: npm run build | ||
|
||
- name: Read properties from package.json | ||
id: package_json | ||
uses: zoexx/github-action-json-file-properties@1.0.6 | ||
with: | ||
file_path: package.json | ||
|
||
- name: set git config | ||
run: | | ||
git config user.name "GitHub Actions" | ||
git config user.email noreply@github.com | ||
- name: Install git flow extensions | ||
run: | | ||
sudo apt-get install git-flow | ||
- run: git flow init --defaults | ||
- run: git flow release start ${{ steps.package_json.outputs.version }} | ||
- run: git flow release finish ${{ steps.package_json.outputs.version }} --push --message "Release" | ||
|
||
- name: Copy to Site | ||
uses: cpina/github-action-push-to-another-repository@v1.7.2 | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.GH_SITE_DEPLOY_PAT }} | ||
with: | ||
source-directory: dist | ||
destination-repository-username: brdgm | ||
destination-repository-name: brdgm.github.io | ||
destination-github-username: ${{ secrets.GH_SITE_DEPLOY_USERNAME }} | ||
user-email: ${{ secrets.GH_SITE_DEPLOY_EMAIL }} | ||
user-name: ${{ secrets.GH_SITE_DEPLOY_NAME }} | ||
target-branch: main | ||
commit-message: deploy ${{ steps.package_json.outputs.appDeployName }} ${{ steps.package_json.outputs.version }} | ||
target-directory: ${{ steps.package_json.outputs.appDeployName }} | ||
|
||
- name: set next version | ||
run: | | ||
npm --no-git-tag-version version patch | ||
git config user.name "GitHub Actions" | ||
git config user.email noreply@github.com | ||
git add package.json package-lock.json | ||
git commit --message "set next version" | ||
git push | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ steps.package_json.outputs.version }} | ||
generateReleaseNotes: true | ||
- uses: brdgm/github-action-release@v1 | ||
id: release | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
gh-site-deploy-pat: ${{ secrets.GH_SITE_DEPLOY_PAT }} | ||
gh-site-deploy-username: ${{ secrets.GH_SITE_DEPLOY_USERNAME }} | ||
gh-site-deploy-email: ${{ secrets.GH_SITE_DEPLOY_EMAIL }} | ||
gh-site-deploy-name: ${{ secrets.GH_SITE_DEPLOY_NAME }} |