diff options
| author | 2020-11-15 01:36:46 +0000 | |
|---|---|---|
| committer | 2020-11-15 01:36:46 +0000 | |
| commit | 0aaf8b749154bdd4a4fe50c523f35822c041fac8 (patch) | |
| tree | 4330a474345be822bc834aa4733287edf517a41e | |
| parent | Update CI badges in README (diff) | |
| parent | Update readme badge (diff) | |
Merge pull request #424 from python-discord/kubernetes-deployment
| -rw-r--r-- | .github/workflows/lint-test-deploy.yaml (renamed from .github/workflows/lint-test-build.yaml) | 19 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | deployment.yaml | 23 | 
3 files changed, 41 insertions, 3 deletions
| diff --git a/.github/workflows/lint-test-build.yaml b/.github/workflows/lint-test-deploy.yaml index e8d4e9cc..754d2e49 100644 --- a/.github/workflows/lint-test-build.yaml +++ b/.github/workflows/lint-test-deploy.yaml @@ -1,4 +1,4 @@ -name: Lint & Test +name: Lint, Test & Deploy  on:    push: @@ -120,7 +120,8 @@ jobs:          run: docker-compose stop          if: ${{ always() }} -  build-and-push: +  build-and-deploy: +    name: Build and Deploy to Kubernetes      needs: lint-test      if: github.event_name != 'pull_request_target' && github.ref == 'refs/heads/master'      runs-on: ubuntu-latest @@ -155,3 +156,17 @@ jobs:            tags: |              ghcr.io/python-discord/site:latest              ghcr.io/python-discord/site:${{ 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/site:${{ steps.sha_tag.outputs.tag }}' +          kubectl-version: 'latest' @@ -1,6 +1,6 @@  # Python Discord: Site  [](https://discord.gg/2B963hn) - +  [](https://coveralls.io/github/python-discord/site?branch=master)  [](LICENSE)  [][1] diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 00000000..b74e42d4 --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,23 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: site +spec: +  replicas: 1 +  selector: +    matchLabels: +      app: site +  template: +    metadata: +      labels: +        app: site +    spec: +      containers: +        - name: site +          image: ghcr.io/python-discord/site:latest +          imagePullPolicy: Always +          ports: +            - containerPort: 8000 +          envFrom: +            - secretRef: +                name: site-env | 
