49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: "Deploy"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- 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
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: git.fascinated.cc/fascinated/scoresaber-reloaded:latest
|
|
build-args: |
|
|
GIT_REV=${{ gitea.sha }}
|
|
cache-from: type=registry,ref=git.fascinated.cc/fascinated/scoresaber-reloaded:cache
|
|
cache-to: type=registry,ref=git.fascinated.cc/fascinated/scoresaber-reloaded:cache,mode=max
|
|
|
|
- name: Install kubectl
|
|
run: sudo apt-get install -y kubectl
|
|
|
|
- name: Setup kubernetes context
|
|
uses: azure/k8s-set-context@v4
|
|
with:
|
|
kubeconfig: ${{ secrets.KUBECONFIG }}
|
|
|
|
- name: Deploy
|
|
run: |
|
|
kubectl apply -f ./gitea/kubernetes/deployment.yaml
|
|
kubectl apply -f ./gitea/kubernetes/service.yaml
|
|
kubectl apply -f ./gitea/kubernetes/ingress.yaml
|