added readme and other changes #3
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
name: Build and Deploy to Kubernetes | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install Dependencies | |
run: npm install | |
- name: Build Application | |
run: npm run build | |
- name: Set Up kubectl | |
uses: azure/setup-kubectl@v3 | |
with: | |
version: 'latest' | |
- name: Create ConfigMaps | |
run: | | |
NAMESPACE="jupyterhub-dev-ns" | |
BASE_DIR="./dist" | |
create_configmap() { | |
local name=$1 | |
local path=$2 | |
kubectl create configmap $name --from-file=$path --dry-run=client -o yaml > $name.yaml | |
} | |
create_configmap "static-files" "$BASE_DIR" | |
create_configmap "static-files-js" "$BASE_DIR/static/custom-js" | |
create_configmap "static-files-css" "$BASE_DIR/static/custom-css" | |
create_configmap "static-files-woff" "$BASE_DIR/static/woff" | |
create_configmap "static-files-woff2" "$BASE_DIR/static/woff2" | |
create_configmap "static-files-images" "$BASE_DIR/static" | |
- name: Upload ConfigMap YAML Files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: configmap-yamls | |
path: ./*.yaml |