-
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.
- Loading branch information
1 parent
c99bfa3
commit 660be7f
Showing
11 changed files
with
215 additions
and
415 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,5 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
dist |
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,35 @@ | ||
name: docker build and push | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
build_and_publish: | ||
name: Build and publish replication-backend package | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: linux/amd64 | ||
context: ./ | ||
push: true | ||
tags: ghcr.io/aam-digital/replication-backend:${{ github.event.release.tag_name }},ghcr.io/aam-digital/replication-backend:latest |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
name: Code Climate on PR | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
code_climate: | ||
name: Code Climate code coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run Tests with coverage | ||
run: npm run test:cov | ||
|
||
- uses: paambaati/codeclimate-action@v5.0.0 | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_ID }} | ||
with: | ||
coverageLocations: coverage/lcov.info:lcov |
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,53 @@ | ||
name: publish release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
verify: | ||
name: Verify replication-backend | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run Tests with coverage | ||
run: npm run test:cov | ||
|
||
- uses: paambaati/codeclimate-action@v5.0.0 | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_ID }} | ||
with: | ||
coverageLocations: coverage/lcov.info:lcov | ||
|
||
publish: | ||
name: Publish Release | ||
runs-on: ubuntu-latest | ||
needs: | ||
- verify | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Semantic Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
npx semantic-release |
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
{ | ||
"branches": ["master"], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"successComment": false, | ||
"failComment": false, | ||
"labels": false | ||
} | ||
] | ||
] | ||
} |
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,35 @@ | ||
FROM node:20-alpine | ||
|
||
USER node | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY --chown=node:node package*.json ./ | ||
|
||
# Some packages enable optimization when this is set | ||
ENV NODE_ENV="production" | ||
|
||
RUN npm ci | ||
|
||
COPY --chown=node:node . . | ||
|
||
RUN npm run build | ||
|
||
# The url of the CouchDB instance | ||
ENV DATABASE_URL="http://localhost:5984" | ||
# The user credentials which can access ALL data on the database | ||
ENV DATABASE_USER="demo" | ||
ENV DATABASE_PASSWORD="pass" | ||
# database name where the permissions definition document is stored | ||
ENV PERMISSION_DB="app" | ||
# A secret which is used to generate the cookies for user authentication | ||
ENV JWT_SECRET="jwtSecret" | ||
# The public key for verifying JWTs | ||
ENV JWT_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\n<PUBLIC_KEY>\n-----END PUBLIC KEY-----" | ||
# (optional) The sentry DSN in order to send the error messages to sentry | ||
ENV SENTRY_DSN="" | ||
# (optional) Port under which the app can be accessed. Default is 3000 | ||
ENV PORT="" | ||
|
||
# Start the server using the production build | ||
CMD [ "node", "dist/main.js" ] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.