Skip to content

Merge pull request #188 from luxfi/fix/server-compile-issues #13

Merge pull request #188 from luxfi/fix/server-compile-issues

Merge pull request #188 from luxfi/fix/server-compile-issues #13

Workflow file for this run

name: Docker Image CI for GHCR for Bridge Server
on:
push:
branches:
- main
paths:
- "server/**" # Only trigger the workflow for changes in the server directory
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: |
corepack enable
pnpm install
working-directory: server
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
run: |
docker login --username "${{ secrets.GH_USER }}" --password "${{ secrets.GH_TOKEN }}" ghcr.io
- name: Run Docker build and push with pnpm script
run: |
pnpm docker:build && pnpm docker:push
working-directory: server
deploy:
needs: build_and_publish
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Set up kubectl
uses: azure/setup-kubectl@v3
with:
version: v1.30.6
- name: Deploy to Kubernetes
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
run: |
pnpm k8s:apply
working-directory: server