Skip to content

1

1 #296

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Write the secret to file
run: echo "${{ secrets.ASPNET_SETTINGS_PRODUCTION }}" | base64 -d > AmiyaBotPlayerRatingServer/appsettings.Production.json
- name: Build
run: |
cd AmiyaBotPlayerRatingServer
dotnet publish -c Release -o ../publish
ls -ltr ../
ls -ltr
- name: Login to Private Harbor
uses: docker/login-action@v2
with:
registry: harbor.hsyhhssyy.net
username: [email protected]
password: ${{ secrets.HARBOR_PUSH_KEY }}
- name: Build and push Docker images
uses: docker/[email protected]
with:
context: .
push: true
tags: harbor.hsyhhssyy.net/home-esxi/amiya-bot-player-rating-server:latest, harbor.hsyhhssyy.net/home-esxi/amiya-bot-player-rating-server:${{ github.sha }}
- name: Setup kubectl
uses: azure/setup-kubectl@v3
id: install
- name: Write Context
uses: azure/k8s-set-context@v1
with:
method: kubeconfig
kubeconfig: ${{ secrets.HOMECLOUD_KUBECONFIG }}
id: setcontext
- name: Push to k8s
uses: Azure/k8s-deploy@v4
with:
namespace: amiya-bot
manifests: pod.yaml
images: |
harbor.hsyhhssyy.net/home-esxi/amiya-bot-player-rating-server:${{ github.sha }}
imagepullsecrets: harbor.hsyhhssyy.net