diff options
author | 2020-11-23 21:50:15 +0100 | |
---|---|---|
committer | 2020-11-23 21:50:15 +0100 | |
commit | 50391ab75fd4acf80693aa576f638b6563fdcf8a (patch) | |
tree | 78edf400f533309bf3da1a1675b0796acb244d21 | |
parent | Narrow down repository events that trigger a build (diff) |
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.
-rw-r--r-- | .github/workflows/build.yaml | 16 | ||||
-rw-r--r-- | deployment.yaml | 21 |
2 files changed, 13 insertions, 24 deletions
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 |