-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure Build & Deploy sequence in CI
I've restructured the build & deploy sequence in our GitHub Actions CI workflow: - There's now a separate workflow to deploy to our cluster - The Build workflow has an additional `if` check to ensure we're only starting the build & deploy sequences for pushes to master - We now checkout the python-discord/kubernetes repo to fetch the deployment.yaml file located in there
- Loading branch information
1 parent
08ab6fe
commit ad84a56
Showing
3 changed files
with
49 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Deploy | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build"] | ||
branches: | ||
- master | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
if: github.event.workflow_run.conclusion == 'success' | ||
name: Deploy to Kubernetes Cluster | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Create SHA Container Tag | ||
id: sha_tag | ||
run: | | ||
tag=$(cut -c 1-7 <<< $GITHUB_SHA) | ||
echo "::set-output name=tag::$tag" | ||
# Check out the private Kubernetes repository for the | ||
# deployment.yaml file using a GitHub Personal Access | ||
# Token to get access. | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: python-discord/kubernetes | ||
token: ${{ secrets.REPO_TOKEN }} | ||
|
||
- 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: | | ||
site/deployment.yaml | ||
images: 'ghcr.io/python-discord/site:${{ steps.sha_tag.outputs.tag }}' | ||
kubectl-version: 'latest' |
This file was deleted.
Oops, something went wrong.