From 50391ab75fd4acf80693aa576f638b6563fdcf8a Mon Sep 17 00:00:00 2001 From: Sebastiaan Zeeff <33516116+SebastiaanZ@users.noreply.github.com> Date: Mon, 23 Nov 2020 21:50:15 +0100 Subject: Use deployment.yaml defined in the kubernetes repo Our dear knight, Sir Lancebot, will now get their deployment information from the private python-discord/kubernetes repository. The workflow will use GitHub Personal Access Token to access this private repository. To not mix up files, the repositories are checked out side-by-side in subdirectories of the workflow directory. --- .github/workflows/build.yaml | 16 +++++++++++++--- deployment.yaml | 21 --------------------- 2 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 deployment.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index abc257f3..b83e15fc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -22,8 +22,18 @@ jobs: tag=$(cut -c 1-7 <<< $GITHUB_SHA) echo "::set-output name=tag::$tag" + # Check out the current repository in the `sir-lancebot` subdirectory - name: Checkout code uses: actions/checkout@v2 + path: sir-lancebot + + # Check out the private "kubernetes" repository in the `kubernetes` + # subdirectory using a GitHub Personal Access Token + - name: Checkout code + uses: actions/checkout@v2 + repository: python-discord/kubernetes + token: ${{ secrets.REPO_TOKEN }} + path: kubernetes - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -41,8 +51,8 @@ jobs: - name: Build and push uses: docker/build-push-action@v2 with: - context: . - file: ./Dockerfile + context: sir-lancebot/ + file: sir-lancebot/Dockerfile push: true cache-from: type=registry,ref=ghcr.io/python-discord/sir-lancebot:latest cache-to: type=inline @@ -60,6 +70,6 @@ jobs: uses: Azure/k8s-deploy@v1 with: manifests: | - deployment.yaml + kubernetes/sir-lancebot/deployment.yaml images: 'ghcr.io/python-discord/sir-lancebot:${{ steps.sha_tag.outputs.tag }}' kubectl-version: 'latest' diff --git a/deployment.yaml b/deployment.yaml deleted file mode 100644 index cad97c18..00000000 --- a/deployment.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: sir-lancebot -spec: - replicas: 1 - selector: - matchLabels: - app: sir-lancebot - template: - metadata: - labels: - app: sir-lancebot - spec: - containers: - - name: sir-lancebot - image: ghcr.io/python-discord/sir-lancebot:latest - imagePullPolicy: Always - envFrom: - - secretRef: - name: sir-lancebot-env -- cgit v1.2.3