2024-10-04 19:35:44 +00:00
|
|
|
name: "Deploy Backend"
|
2024-09-24 08:57:05 +00:00
|
|
|
|
|
|
|
on:
|
2024-10-04 20:10:55 +00:00
|
|
|
workflow_dispatch:
|
2024-09-24 08:57:05 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2024-10-04 20:09:04 +00:00
|
|
|
paths:
|
|
|
|
- backend/**
|
2024-10-04 21:26:09 +00:00
|
|
|
- common/**
|
2024-10-04 20:46:49 +00:00
|
|
|
- .gitea/kubernetes/backend/**
|
|
|
|
- .gitea/workflows/deploy-backend.yml
|
2024-09-24 08:57:05 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-09-24 10:03:20 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-09-24 08:57:05 +00:00
|
|
|
|
2024-09-24 09:37:30 +00:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
registry: git.fascinated.cc
|
|
|
|
|
2024-09-24 09:43:05 +00:00
|
|
|
- name: Build Image
|
2024-09-24 09:37:30 +00:00
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
2024-10-02 16:39:12 +00:00
|
|
|
context: .
|
2024-10-08 14:33:41 +00:00
|
|
|
file: ./projects/backend/Dockerfile
|
2024-09-24 09:37:30 +00:00
|
|
|
push: true
|
2024-09-24 10:05:05 +00:00
|
|
|
tags: |
|
2024-10-04 19:35:44 +00:00
|
|
|
git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}
|
|
|
|
git.fascinated.cc/fascinated/scoresaber-reloaded-backend:latest
|
2024-09-24 09:37:30 +00:00
|
|
|
build-args: |
|
|
|
|
GIT_REV=${{ gitea.sha }}
|
2024-09-24 08:57:05 +00:00
|
|
|
|
2024-09-24 09:30:32 +00:00
|
|
|
- name: Install kubectl
|
2024-09-24 09:34:09 +00:00
|
|
|
uses: azure/setup-kubectl@v4
|
|
|
|
id: install
|
2024-09-24 09:30:32 +00:00
|
|
|
|
2024-09-24 09:43:05 +00:00
|
|
|
- name: Setup Kubernetes Context
|
2024-09-24 09:23:53 +00:00
|
|
|
uses: azure/k8s-set-context@v4
|
2024-09-24 08:57:05 +00:00
|
|
|
with:
|
|
|
|
kubeconfig: ${{ secrets.KUBECONFIG }}
|
|
|
|
|
2024-10-04 20:46:49 +00:00
|
|
|
- name: Deploy to Kubernetes
|
|
|
|
uses: Azure/k8s-deploy@v5
|
|
|
|
with:
|
|
|
|
action: deploy
|
|
|
|
namespace: public-services
|
|
|
|
manifests: |
|
|
|
|
.gitea/kubernetes/backend/deployment.yaml
|
|
|
|
.gitea/kubernetes/backend/service.yaml
|
2024-10-04 22:14:26 +00:00
|
|
|
.gitea/kubernetes/backend/strip-api-prefix-middleware.yaml
|
2024-10-04 20:46:49 +00:00
|
|
|
.gitea/kubernetes/backend/ingress.yaml
|
|
|
|
images: |
|
|
|
|
git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}
|