This commit is contained in:
parent
de05aceb9f
commit
31f57cbe6b
@ -1,4 +1,4 @@
|
|||||||
name: "Deploy Backend"
|
name: Deploy Backend
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -8,57 +8,91 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- projects/backend/**
|
- projects/backend/**
|
||||||
- projects/common/**
|
- projects/common/**
|
||||||
- .gitea/kubernetes/backend/**
|
|
||||||
- .gitea/workflows/deploy-backend.yml
|
- .gitea/workflows/deploy-backend.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: ["ubuntu-latest"]
|
||||||
|
runs-on: ${{ matrix.arch }}
|
||||||
|
|
||||||
|
# Steps to run
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
# Checkout the repo
|
||||||
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
fetch-depth: 0
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
registry: git.fascinated.cc
|
|
||||||
|
|
||||||
- name: Build Image
|
# Deploy to Dokku
|
||||||
uses: docker/build-push-action@v6
|
- name: Push to dokku
|
||||||
|
uses: dokku/github-action@master
|
||||||
with:
|
with:
|
||||||
context: .
|
git_remote_url: "ssh://dokku@51.158.63.74:22/ssr-backend"
|
||||||
file: ./projects/backend/Dockerfile
|
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}
|
|
||||||
git.fascinated.cc/fascinated/scoresaber-reloaded-backend:latest
|
|
||||||
build-args: |
|
|
||||||
GIT_REV=${{ gitea.sha }}
|
|
||||||
|
|
||||||
- name: Install kubectl
|
#name: "Deploy Backend"
|
||||||
uses: azure/setup-kubectl@v4
|
#
|
||||||
id: install
|
#on:
|
||||||
|
# workflow_dispatch:
|
||||||
- name: Setup Kubernetes Context
|
# push:
|
||||||
uses: azure/k8s-set-context@v4
|
# branches:
|
||||||
with:
|
# - master
|
||||||
kubeconfig: ${{ secrets.KUBECONFIG }}
|
# paths:
|
||||||
|
# - projects/backend/**
|
||||||
- name: Deploy to Kubernetes
|
# - projects/common/**
|
||||||
uses: Azure/k8s-deploy@v5
|
# - .gitea/kubernetes/backend/**
|
||||||
with:
|
# - .gitea/workflows/deploy-backend.yml
|
||||||
action: deploy
|
#
|
||||||
namespace: public-services
|
#jobs:
|
||||||
manifests: |
|
# deploy:
|
||||||
.gitea/kubernetes/backend/sealed-secret.yaml
|
# runs-on: ubuntu-latest
|
||||||
.gitea/kubernetes/backend/deployment.yaml
|
# steps:
|
||||||
.gitea/kubernetes/backend/service.yaml
|
# - name: Checkout code
|
||||||
.gitea/kubernetes/backend/strip-api-prefix-middleware.yaml
|
# uses: actions/checkout@v4
|
||||||
.gitea/kubernetes/backend/ingress.yaml
|
#
|
||||||
images: |
|
# - name: Set up Docker Buildx
|
||||||
git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}
|
# 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
|
||||||
|
#
|
||||||
|
# - name: Build Image
|
||||||
|
# uses: docker/build-push-action@v6
|
||||||
|
# with:
|
||||||
|
# context: .
|
||||||
|
# file: ./projects/backend/Dockerfile
|
||||||
|
# push: true
|
||||||
|
# tags: |
|
||||||
|
# git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}
|
||||||
|
# git.fascinated.cc/fascinated/scoresaber-reloaded-backend:latest
|
||||||
|
# build-args: |
|
||||||
|
# GIT_REV=${{ gitea.sha }}
|
||||||
|
#
|
||||||
|
# - name: Install kubectl
|
||||||
|
# uses: azure/setup-kubectl@v4
|
||||||
|
# id: install
|
||||||
|
#
|
||||||
|
# - name: Setup Kubernetes Context
|
||||||
|
# uses: azure/k8s-set-context@v4
|
||||||
|
# with:
|
||||||
|
# kubeconfig: ${{ secrets.KUBECONFIG }}
|
||||||
|
#
|
||||||
|
# - name: Deploy to Kubernetes
|
||||||
|
# uses: Azure/k8s-deploy@v5
|
||||||
|
# with:
|
||||||
|
# action: deploy
|
||||||
|
# namespace: public-services
|
||||||
|
# manifests: |
|
||||||
|
# .gitea/kubernetes/backend/sealed-secret.yaml
|
||||||
|
# .gitea/kubernetes/backend/deployment.yaml
|
||||||
|
# .gitea/kubernetes/backend/service.yaml
|
||||||
|
# .gitea/kubernetes/backend/strip-api-prefix-middleware.yaml
|
||||||
|
# .gitea/kubernetes/backend/ingress.yaml
|
||||||
|
# images: |
|
||||||
|
# git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}
|
||||||
|
Reference in New Issue
Block a user