Skip to content

Create deploy.yml

Create deploy.yml #1

Workflow file for this run

name: Deploy Vite React App to k3s
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Build the Vite app
run: npm run build
- name: Build Docker image
run: docker build -t ${{ secrets.DOCKER_REGISTRY }}/oeteco_front:latest .
- name: Push Docker image
run: docker push ${{ secrets.DOCKER_REGISTRY }}/oeteco_front:latest
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Set up KUBECONFIG
run: |
mkdir $HOME/.kube
echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config
- name: Install kubectl
uses: azure/setup-kubectl@v3
with:
version: 'latest'
- name: Rollout restart the deployment
run: |
kubectl rollout restart -n lgtu deployments/oeteco-front