Merge branch 'dev'
This commit is contained in:
commit
3ff9427301
2
.github/workflows/deploy-base.yaml
vendored
2
.github/workflows/deploy-base.yaml
vendored
@ -23,7 +23,7 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
runs-on: [self-hosted, ubuntu-focal]
|
runs-on: ubuntu-20.04
|
||||||
environment:
|
environment:
|
||||||
url: ${{ inputs.env_url }}
|
url: ${{ inputs.env_url }}
|
||||||
name: ${{ inputs.env_name }}
|
name: ${{ inputs.env_name }}
|
||||||
|
|||||||
34
.github/workflows/deploy-dev.yaml
vendored
34
.github/workflows/deploy-dev.yaml
vendored
@ -9,7 +9,7 @@ on:
|
|||||||
- ".vscode/**"
|
- ".vscode/**"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: deploy-${{ github.ref }}
|
group: deploy-dev
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -17,12 +17,10 @@ jobs:
|
|||||||
name: Setup
|
name: Setup
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
env:
|
env:
|
||||||
IMAGE_REPO: reg.dev.krd/dit-docs/dsm-client
|
IMAGE: "reg.dev.krd/dit-docs/dsm-client:${{ github.ref_name }}"
|
||||||
steps:
|
steps:
|
||||||
- name: Extract image name
|
- name: Extract image name
|
||||||
run: |
|
run: echo "Using image name $IMAGE"
|
||||||
REF_NAME=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "IMAGE=$IMAGE_REPO:$REF_NAME" >> $GITHUB_ENV
|
|
||||||
outputs:
|
outputs:
|
||||||
image: ${{ env.IMAGE }}
|
image: ${{ env.IMAGE }}
|
||||||
image-sha: ${{ env.IMAGE }}-${{ github.sha }}
|
image-sha: ${{ env.IMAGE }}-${{ github.sha }}
|
||||||
@ -30,21 +28,35 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
uses: ditkrg/dit-digital-service-manual/.github/workflows/tests-base.yaml@dev
|
uses: ditkrg/dit-digital-service-manual/.github/workflows/tests-base.yaml@dev
|
||||||
|
|
||||||
build:
|
build-push:
|
||||||
uses: ditkrg/common-github-workflows/.github/workflows/build-push-image.yaml@main
|
name: Build and Push
|
||||||
needs: [setup, test]
|
needs: [setup, test]
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
timeout-minutes: 10
|
||||||
|
steps:
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
|
registry: reg.dev.krd
|
||||||
|
username: ${{ secrets.HARBOR_PUBLIC_USER }}
|
||||||
|
password: ${{ secrets.HARBOR_PUBLIC_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push Docker images
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
tags: |-
|
tags: |-
|
||||||
${{ needs.setup.outputs.image }}
|
${{ needs.setup.outputs.image }}
|
||||||
${{ needs.setup.outputs.image-sha }}
|
${{ needs.setup.outputs.image-sha }}
|
||||||
cache-from: type=registry,ref=${{ needs.setup.outputs.image }}
|
cache-from: type=registry,ref=${{ needs.setup.outputs.image }}
|
||||||
secrets:
|
cache-to: type=inline
|
||||||
username: ${{ secrets.HARBOR_USER }}
|
|
||||||
password: ${{ secrets.HARBOR_TOKEN }}
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
uses: ditkrg/dit-digital-service-manual/.github/workflows/deploy-base.yaml@dev
|
uses: ditkrg/dit-digital-service-manual/.github/workflows/deploy-base.yaml@dev
|
||||||
needs: [setup, build]
|
needs: [setup, build-push]
|
||||||
with:
|
with:
|
||||||
image: ${{ needs.setup.outputs.image-sha }}
|
image: ${{ needs.setup.outputs.image-sha }}
|
||||||
env_url: https://service-manual.docs.dev.krd
|
env_url: https://service-manual.docs.dev.krd
|
||||||
|
|||||||
26
.github/workflows/deploy-production.yaml
vendored
26
.github/workflows/deploy-production.yaml
vendored
@ -28,21 +28,35 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
uses: ditkrg/dit-digital-service-manual/.github/workflows/tests-base.yaml@main
|
uses: ditkrg/dit-digital-service-manual/.github/workflows/tests-base.yaml@main
|
||||||
|
|
||||||
build:
|
build-push:
|
||||||
uses: ditkrg/common-github-workflows/.github/workflows/build-push-image.yaml@main
|
name: Build and Push
|
||||||
needs: [setup, test]
|
needs: [setup, test]
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
timeout-minutes: 10
|
||||||
|
steps:
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
|
registry: reg.dev.krd
|
||||||
|
username: ${{ secrets.HARBOR_PUBLIC_USER }}
|
||||||
|
password: ${{ secrets.HARBOR_PUBLIC_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push Docker images
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
tags: |-
|
tags: |-
|
||||||
${{ needs.setup.outputs.image }}
|
${{ needs.setup.outputs.image }}
|
||||||
${{ needs.setup.outputs.image-sha }}
|
${{ needs.setup.outputs.image-sha }}
|
||||||
cache-from: type=registry,ref=${{ needs.setup.outputs.image }}
|
cache-from: type=registry,ref=${{ needs.setup.outputs.image }}
|
||||||
secrets:
|
cache-to: type=inline
|
||||||
username: ${{ secrets.HARBOR_USER }}
|
|
||||||
password: ${{ secrets.HARBOR_TOKEN }}
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
uses: ditkrg/dit-digital-service-manual/.github/workflows/deploy-base.yaml@main
|
uses: ditkrg/dit-digital-service-manual/.github/workflows/deploy-base.yaml@main
|
||||||
needs: [setup, build]
|
needs: [setup, build-push]
|
||||||
with:
|
with:
|
||||||
image: ${{ needs.setup.outputs.image-sha }}
|
image: ${{ needs.setup.outputs.image-sha }}
|
||||||
env_url: https://docs.digital.gov.krd
|
env_url: https://docs.digital.gov.krd
|
||||||
|
|||||||
2
.github/workflows/tests-base.yaml
vendored
2
.github/workflows/tests-base.yaml
vendored
@ -24,7 +24,7 @@ jobs:
|
|||||||
- name: Build k8s manifests
|
- name: Build k8s manifests
|
||||||
working-directory: kubernetes
|
working-directory: kubernetes
|
||||||
run: |
|
run: |
|
||||||
envs=( "development" )
|
envs=( "development" "production" )
|
||||||
|
|
||||||
for i in "${envs[@]}"
|
for i in "${envs[@]}"
|
||||||
do
|
do
|
||||||
|
|||||||
5
.github/workflows/tests-run.yaml
vendored
5
.github/workflows/tests-run.yaml
vendored
@ -7,9 +7,8 @@ on:
|
|||||||
- staging
|
- staging
|
||||||
- main
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "**.md"
|
- "README.md"
|
||||||
- ".vscode/**"
|
- ".vscode/**"
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-tests:
|
run-tests:
|
||||||
@ -32,7 +31,7 @@ jobs:
|
|||||||
- name: Build k8s manifests
|
- name: Build k8s manifests
|
||||||
working-directory: kubernetes
|
working-directory: kubernetes
|
||||||
run: |
|
run: |
|
||||||
envs=( "development" )
|
envs=( "development" "production" )
|
||||||
|
|
||||||
for i in "${envs[@]}"
|
for i in "${envs[@]}"
|
||||||
do
|
do
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
FROM reg.dev.krd/hub.docker/library/node:16 as build-stage
|
FROM node:16 as build-stage
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -13,8 +13,7 @@ COPY *.js ./
|
|||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM reg.dev.krd/hub.docker/library/nginx:1.20-alpine AS production
|
FROM nginxinc/nginx-unprivileged:1.20-alpine AS production
|
||||||
|
|
||||||
COPY --from=build-stage /app/build /usr/share/nginx/html
|
COPY --from=build-stage /app/build /usr/share/nginx/html
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
EXPOSE 8080
|
||||||
EXPOSE 80
|
|
||||||
|
|||||||
@ -17,6 +17,12 @@ spec:
|
|||||||
app: dsm-client
|
app: dsm-client
|
||||||
|
|
||||||
spec:
|
spec:
|
||||||
|
securityContext:
|
||||||
|
fsGroup: 101
|
||||||
|
runAsUser: 101
|
||||||
|
runAsGroup: 101
|
||||||
|
runAsNonRoot: true
|
||||||
|
|
||||||
containers:
|
containers:
|
||||||
- name: dsm-client
|
- name: dsm-client
|
||||||
image: IMAGE
|
image: IMAGE
|
||||||
@ -28,11 +34,22 @@ spec:
|
|||||||
memory: 32Mi
|
memory: 32Mi
|
||||||
cpu: 5m
|
cpu: 5m
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- name: http
|
||||||
|
containerPort: 8080
|
||||||
|
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: http
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 6
|
||||||
|
successThreshold: 1
|
||||||
|
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: http
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 3
|
||||||
|
successThreshold: 1
|
||||||
initialDelaySeconds: 5
|
initialDelaySeconds: 5
|
||||||
periodSeconds: 15
|
|
||||||
httpGet:
|
|
||||||
path: /health
|
|
||||||
port: 80
|
|
||||||
|
|||||||
@ -10,4 +10,5 @@ spec:
|
|||||||
app: dsm-client
|
app: dsm-client
|
||||||
ports:
|
ports:
|
||||||
- port: 80
|
- port: 80
|
||||||
|
targetPort: 8080
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
|
|||||||
15
nginx.conf
15
nginx.conf
@ -1,15 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /health {
|
|
||||||
access_log off;
|
|
||||||
default_type text/plain;
|
|
||||||
return 200 "Healthy\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user