Skip to content

Commit 48518f4

Browse files
author
Backstage
committed
initial commit
0 parents  commit 48518f4

36 files changed

+9432
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
k8s
2+
docs
3+
.github

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## RunTime
2+
NODE_ENV=example

.eslintrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
tsconfigRootDir: __dirname,
6+
sourceType: 'module',
7+
},
8+
plugins: ['@typescript-eslint/eslint-plugin'],
9+
extends: [
10+
'plugin:@typescript-eslint/recommended',
11+
'plugin:prettier/recommended',
12+
],
13+
root: true,
14+
env: {
15+
node: true,
16+
jest: true,
17+
},
18+
ignorePatterns: ['.eslintrc.js'],
19+
rules: {
20+
'@typescript-eslint/interface-name-prefix': 'off',
21+
'@typescript-eslint/explicit-function-return-type': 'off',
22+
'@typescript-eslint/explicit-module-boundary-types': 'off',
23+
'@typescript-eslint/no-explicit-any': 'off',
24+
},
25+
};
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build Container Image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ['main']
7+
paths:
8+
- 'src/**'
9+
# pull_request:
10+
# branches: ['main']
11+
12+
jobs:
13+
# ------------------------------------------ job 1
14+
build-and-publish:
15+
runs-on: ubuntu-latest
16+
17+
outputs:
18+
newtag: ${{ steps.export_tag.outputs.sha }}
19+
shorttag: ${{ steps.export_tag.outputs.short }}
20+
21+
steps:
22+
- name: Export sha as short tag
23+
id: export_tag
24+
run: |
25+
export "SHA=${{ github.sha }}"
26+
echo $SHA
27+
echo "${SHA:0:7}"
28+
export "SHORT=${SHA:0:7}"
29+
echo "sha=${{github.sha}}" >> $GITHUB_OUTPUT
30+
echo "short=${SHORT}" >> $GITHUB_OUTPUT
31+
32+
- name: Build, Tag and Push Docker Image to GHCR
33+
uses: GlueOps/[email protected]
34+
35+
# ------------------------------------------ job 2
36+
update-deployed-image-tag:
37+
runs-on: ubuntu-latest
38+
needs: build-and-publish
39+
steps:
40+
- name: Checkout code
41+
uses: actions/checkout@v3
42+
with:
43+
repository: xgeekshq/xgeeks-nestjs-api_deployment
44+
token: ${{ secrets.IDP_TOKEN_G }}
45+
46+
- name: Install Kustomize
47+
uses: imranismail/setup-kustomize@v2
48+
49+
- name: Kustomize deployment image tag
50+
env:
51+
NEW_TAG: ${{ needs.build-and-publish.outputs.newtag }}
52+
SHORT_TAG: ${{ needs.build-and-publish.outputs.shorttag }}
53+
run: |
54+
cd k8s/overlays/dev
55+
echo $NEW_TAG
56+
echo $SHORT_TAG
57+
kustomize edit set image ghcr.io/xgeekshq/xgeeks-nestjs-api:${{ env.SHORT_TAG }}
58+
git config --local user.email "[email protected]"
59+
git config --local user.name "CD Action"
60+
git add .
61+
git commit -m "ci: update 'xgeeks-nestjs-api' image tag to '${{ env.SHORT_TAG }}' "
62+
git push

.github/workflows/techdocs.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish TechDocs Site
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'mkdocs.yml'
10+
- '.github/workflows/techdocs.yaml'
11+
12+
jobs:
13+
publish-techdocs-site:
14+
name: Publish TechDocs Site
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
- name: Setup Node
20+
uses: Staffbase/[email protected]
21+
with:
22+
entity-name: xgeeks-nestjs-api
23+
entity-kind: Component #(default=Component)
24+
entity-namespace: default # (default="default")
25+
publisher-type: 'azureBlobStorage' #'awsS3'
26+
storage-name: 'techdocs' # aws=BucketName, azure=ContainerName
27+
azure-account-name: ${{ secrets.AZ_STOR_ACCOUNT_NAME }}
28+
azure-account-key: ${{ secrets.AZ_STOR_ACCOUNT_KEY }}

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# compiled output
2+
/dist
3+
/node_modules
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
pnpm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# OS
15+
.DS_Store
16+
17+
# Tests
18+
/coverage
19+
/.nyc_output
20+
21+
# IDEs and editors
22+
/.idea
23+
.project
24+
.classpath
25+
.c9/
26+
*.launch
27+
.settings/
28+
*.sublime-workspace
29+
30+
# IDE - VSCode
31+
.vscode/*
32+
!.vscode/settings.json
33+
!.vscode/tasks.json
34+
!.vscode/launch.json
35+
!.vscode/extensions.json

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

0 commit comments

Comments
 (0)