-
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.
chore: set up deployment gf-18 (#111)
* chore: set up deployment gf-18 * chore: remove nodejs step in cd workflow gf-18
- Loading branch information
Showing
6 changed files
with
89 additions
and
13 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,62 @@ | ||
name: Continuous Delivery | ||
|
||
env: | ||
EBS_ENVIRONMENT_NAME: development | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.ref_name }} | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
outputs: | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
steps: | ||
- name: Code Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Release | ||
id: release | ||
uses: googleapis/release-please-action@v4 | ||
with: | ||
manifest-file: .release-please-manifest.json | ||
config-file: release-please-config.json | ||
|
||
deploy: | ||
name: Deploy | ||
needs: release | ||
if: ${{ needs.release.outputs.release_created }} | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: development | ||
url: http://git-fit-development.eu-central-1.elasticbeanstalk.com/ | ||
|
||
steps: | ||
- name: Code Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare deployment package | ||
run: | | ||
zip -r build.zip . -x .github | ||
- name: Deploy to Beanstalk | ||
uses: einaregilsson/beanstalk-deploy@v22 | ||
with: | ||
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
region: ${{ secrets.AWS_REGION }} | ||
application_name: ${{ secrets.EBS_APPLICATION_NAME }} | ||
environment_name: ${{ env.EBS_ENVIRONMENT_NAME }} | ||
version_label: ${{ github.sha }} | ||
deployment_package: ./build.zip |
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
8 changes: 5 additions & 3 deletions
8
apps/backend/src/libs/modules/server-application/libs/constants/white-routes.constant.ts
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,6 +1,8 @@ | ||
import { APIPath, AuthApiPath } from "@git-fit/shared"; | ||
|
||
const WHITE_ROUTES = [ | ||
/^\/api\/v1\/[^/]+\/sign-up\/?$/, | ||
/^\/api\/v1\/[^/]+\/sign-in\/?$/, | ||
] as const; | ||
`${APIPath.AUTH}${AuthApiPath.SIGN_UP}`, | ||
`${APIPath.AUTH}${AuthApiPath.SIGN_IN}`, | ||
]; | ||
|
||
export { WHITE_ROUTES }; |
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
13 changes: 13 additions & 0 deletions
13
apps/backend/src/libs/plugins/authorization/helpers/check-is-white-route.helper.ts
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,13 @@ | ||
const checkIsWhiteRoute = (url: string, whiteRoutes: string[]): boolean => { | ||
const apiUrlRegex = /^\/api\/v\d+(\/.+)$/; | ||
const match = url.match(apiUrlRegex); | ||
const [, route] = match ?? []; | ||
|
||
if (!route) { | ||
return true; | ||
} | ||
|
||
return whiteRoutes.includes(route); | ||
}; | ||
|
||
export { checkIsWhiteRoute }; |
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 @@ | ||
export { checkIsWhiteRoute } from "./check-is-white-route.helper.js"; |