Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deployment manifests #88

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
k8s
15 changes: 15 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Continuous Deployment"
on:
push:
branches:
- main
release:
types:
- published

jobs:
cd:
uses: LCOGT/reusable-workflows/.github/workflows/continuous-deployment.yaml@main
with:
secretsExposedToSkaffold: 'FONTAWESOME_PACKAGE_TOKEN,'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows us to send the package token to skaffold, which is used in the reusable workflow to build the docker image.

secrets: inherit
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?
.devenv
.pre-commit-config.yaml

k8s/base/secrets.env
skaffold.env
local-kubeconfig
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:22
ARG FONTAWESOME_PACKAGE_TOKEN
WORKDIR /app
COPY package*.json ./
COPY .npmrc ./
RUN npm install
COPY ./ .
RUN npm run build
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,41 @@ npm run build
npm run lint
```

## Running this project locally via Kubernetes

This project includes kubernetes manifests that allow it to be deployed to a kubernetes cluster.

To run this project in a local kind cluster:

Drop into the nix environment that contains all of the relevant tools.
```
nix develop --impure
```

Create a cluster and container registry.
```
ctlptl apply -f local-cluster.yaml -f local-registry.yaml
```

Make sure you update the skaffold.env.changeme and k8s/base/secrets.env.changeme to include the fontawesome package token

```
mv skaffold.env.changeme skaffold.env
mv k8s/base/secrets.env.changeme k8s/base/secrets.env
```

Then edit these and insert the token.

Finally, to build and deploy the service to the cluster we just created:
```
skaffold -m app dev --port-forward
```

This starts the skaffold dev loop, which will rebuild the Docker image on code change, and will re-deploy the artifacts automatically.

The service will be available at http://localhost:8080


### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
=======
Expand Down
Loading
Loading