-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from dxfrontier/singular-entity
Singular entity
- Loading branch information
Showing
9 changed files
with
556 additions
and
358 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,83 @@ | ||
name: Deployment | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- dev | ||
types: | ||
- closed | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
# This job will check if the Pull request was merged into dev branch | ||
check_valid_merge: | ||
name: Merge 'Pull request' to 'dev' branch | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo The PR was merged. | ||
# This will validate to see if the labels contains 'none' which means that if 'none' was found the release will not happen | ||
check_valid_deploy: | ||
name: Validate deploy conditions | ||
needs: check_valid_merge | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo The PR can continue to deploy the version. | ||
# This will start build of the project | ||
check_valid_build: | ||
name: Check build validity | ||
runs-on: ubuntu-latest | ||
needs: [check_valid_deploy] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: npm install | ||
- run: npm run build | ||
|
||
# This will push the latest build of the project to npm | ||
publish-npm: | ||
name: Publish to npm public | ||
needs: check_valid_build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- run: npm ci | ||
- run: npm run build | ||
- run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | ||
|
||
publish-npm-github: | ||
name: Publish to github npm - internal | ||
needs: check_valid_build | ||
env: | ||
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
- run: npm ci | ||
- run: npm run build | ||
- run: | | ||
echo @dxfrontier:registry=https://npm.pkg.github.com/ > ~/.npmrc | ||
echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" >> ~/.npmrc | ||
- run: npm publish |
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
Oops, something went wrong.