-
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.
update gh action to build image and add helm chart for deployment
- Loading branch information
1 parent
f4c1581
commit c86a930
Showing
7 changed files
with
97 additions
and
4 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,20 @@ | ||
FROM node:21-alpine3.17 as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json ./ | ||
COPY package-lock.json ./ | ||
|
||
RUN npm install | ||
|
||
#RUN npm install --save nuxt | ||
|
||
RUN npm install nuxt | ||
|
||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
EXPOSE 3000 | ||
|
||
CMD node ./.output/server/index.mjs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Build Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- 'develop/**' | ||
|
||
env: | ||
IMAGE_NAME: formtion-frontend | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build image | ||
run: docker build . --file ./.docker/Dockerfile --tag $IMAGE_NAME |
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,25 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
env: | ||
IMAGE_NAME: mattiamueggler-ch | ||
IMAGE_TAG: ${{ github.event.release.tag_name }} # eg. v0.0.1 | ||
GH_USERNAME: m-mattia-m | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build image | ||
run: docker build . --file ./.docker/Dockerfile --tag $IMAGE_NAME --label $IMAGE_TAG | ||
- name: Log in to registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
- name: Add tag to image | ||
run: docker tag $IMAGE_NAME ghcr.io/$GH_USERNAME/$IMAGE_NAME:$IMAGE_TAG | ||
- name: Push image to container-registry | ||
run: docker push ghcr.io/$GH_USERNAME/$IMAGE_NAME:$IMAGE_TAG |
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 |
---|---|---|
|
@@ -24,4 +24,7 @@ logs | |
!.env.example | ||
|
||
# Nuxt | ||
.nuxt | ||
.nuxt | ||
|
||
# Deployment | ||
helm/values.yaml |
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,4 @@ | ||
apiVersion: v1 | ||
description: A Helm chart to deploy this nuxt site on kubernetes for Kubernetes. | ||
name: mattiamueggler-ch | ||
version: 1.0.0 |
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,22 @@ | ||
# Deployment | ||
|
||
## values.yaml | ||
|
||
```yaml | ||
deployment: | ||
namespace: adsf | ||
name: adfd | ||
image: | ||
repository: ghcr.io/mattiamueggler/test-api | ||
tag: 1.0.0 | ||
replicaCount: 1 | ||
pullPolicy: always | ||
resources: | ||
requests: | ||
cpu: 200m | ||
memory: 300Mi | ||
secret: | ||
nuxtDriveUploadUrl: https://kdrive.infomaniak.com/app/collaborate/590672/7efd85c4-76d2-4109-9cfd-e896b3346e1e | ||
nuxtDriveDownloadUrl: https://kdrive.infomaniak.com/app/share/590672/c90c9156-d7ce-4560-8950-32c22f28c652 | ||
nuxtDrivePassword: MySafePassword123! | ||
``` |