scoresaber-reloadedv3/.gitea/workflows/deploy.yml

63 lines
1.6 KiB
YAML
Raw Normal View History

2024-09-24 08:57:05 +00:00
name: "Deploy"
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
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: Cache Docker Layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Image
2024-09-24 09:37:30 +00:00
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: git.fascinated.cc/fascinated/scoresaber-reloaded:latest
build-args: |
GIT_REV=${{ gitea.sha }}
2024-09-24 09:43:54 +00:00
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
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-09-24 09:43:05 +00:00
- name: Deploy to Kubernetes
uses: Azure/k8s-deploy@v5
2024-09-24 09:39:28 +00:00
with:
action: deploy
2024-09-24 09:46:00 +00:00
namespace: public-services
2024-09-24 10:00:33 +00:00
force: true
2024-09-24 09:39:28 +00:00
manifests: |
.gitea/kubernetes/deployment.yaml
.gitea/kubernetes/service.yaml
.gitea/kubernetes/ingress.yaml