diff options
| author | 2020-11-14 22:53:49 +0000 | |
|---|---|---|
| committer | 2020-11-14 22:53:49 +0000 | |
| commit | 1b1947446cfa86c8fe0c58f731e0c6c4f1a8c1cc (patch) | |
| tree | 139103d9cbd5a988e7b6536cce8a255da1aa8245 | |
| parent | Merge pull request #515 from python-discord/feature/non-persistence (diff) | |
| parent | Merge build and deploy stages (diff) | |
Merge pull request #516 from python-discord/kubernetes-deploy
| -rw-r--r-- | .github/workflows/lint-build-deploy.yaml (renamed from .github/workflows/lint-build.yaml) | 20 | ||||
| -rw-r--r-- | deployment.yaml | 21 | 
2 files changed, 38 insertions, 3 deletions
| diff --git a/.github/workflows/lint-build.yaml b/.github/workflows/lint-build-deploy.yaml index 7001bc66..7ce5d9a3 100644 --- a/.github/workflows/lint-build.yaml +++ b/.github/workflows/lint-build-deploy.yaml @@ -1,4 +1,4 @@ -name: Linting & Building +name: Lint, Build & Deploy  on:    push: @@ -94,8 +94,8 @@ jobs:          env:            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -  build-and-push: -    name: Build and Push to Container Repositories +  build-and-deploy: +    name: Build and Deploy to Kubernetes      needs: lint      if: github.event_name != 'pull_request_target' && github.ref == 'refs/heads/master'      runs-on: ubuntu-latest @@ -142,3 +142,17 @@ jobs:              ghcr.io/python-discord/seasonalbot:${{ steps.sha_tag.outputs.tag }}              pythondiscord/seasonalbot:latest              pythondiscord/seasonalbot:${{ steps.sha_tag.outputs.tag }} + +      - name: Authenticate with Kubernetes +        uses: azure/k8s-set-context@v1 +        with: +          method: kubeconfig +          kubeconfig: ${{ secrets.KUBECONFIG }} + +      - name: Deploy to Kubernetes +        uses: Azure/k8s-deploy@v1 +        with: +          manifests: | +              deployment.yaml +          images: 'ghcr.io/python-discord/seasonalbot:${{ steps.sha_tag.outputs.tag }}' +          kubectl-version: 'latest' diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 00000000..b04b528c --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: seasonalbot +spec: +  replicas: 1 +  selector: +    matchLabels: +      app: seasonalbot +  template: +    metadata: +      labels: +        app: seasonalbot +    spec: +      containers: +      - name: seasonalbot +        image: ghcr.io/python-discord/seasonalbot:latest +        imagePullPolicy: Always +        envFrom: +        - secretRef: +            name: seasonalbot-env | 
