This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
forked from cpfair/tapiriik
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from neilboyd/action
Github Action to deploy to AKS
- Loading branch information
Showing
5 changed files
with
68 additions
and
34 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,38 @@ | ||
name: Docker build and push, Kubernetes apply | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Docker Login | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Kubernetes set context | ||
uses: Azure/k8s-set-context@v1 | ||
with: | ||
method: kubeconfig | ||
kubeconfig: ${{ secrets.KUBE_CONFIG }} | ||
|
||
- name: Docker build and push | ||
run: | | ||
docker build --tag ${{ secrets.DOCKER_USERNAME }}/tapiriik:${{ github.sha }} . | ||
docker push ${{ secrets.DOCKER_USERNAME }}/tapiriik:${{ github.sha }} | ||
- name: kubectl apply | ||
# NB: the secrets need to be friendly to sed, eg & should be escaped as \& | ||
run: | | ||
sed -i'' -e 's#WEB_ROOT#${{ secrets.WEB_ROOT }}#g' -e 's/ALLOWED_HOSTS/${{ secrets.ALLOWED_HOSTS }}/g' -e 's#REDIS_HOST#${{ secrets.REDIS_HOST }}#g' -e 's#RABBITMQ_BROKER_URL#${{ secrets.RABBITMQ_BROKER_URL }}#g' -e 's#MONGO_HOST#${{ secrets.MONGO_HOST }}#g' -e 's/RUNKEEPER_CLIENT_ID/${{ secrets.RUNKEEPER_CLIENT_ID }}/g' -e 's/RUNKEEPER_CLIENT_SECRET/${{ secrets.RUNKEEPER_CLIENT_SECRET }}/g' -e 's/DROPBOX_APP_KEY/${{ secrets.DROPBOX_APP_KEY }}/g' -e 's/DROPBOX_APP_SECRET/${{ secrets.DROPBOX_APP_SECRET }}/g' -e 's/DROPBOX_FULL_APP_KEY/${{ secrets.DROPBOX_FULL_APP_KEY }}/g' -e 's/DROPBOX_FULL_APP_SECRET/${{ secrets.DROPBOX_FULL_APP_SECRET }}/g' -e 's/STRAVA_CLIENT_ID/${{ secrets.STRAVA_CLIENT_ID }}/g' -e 's/STRAVA_CLIENT_SECRET/${{ secrets.STRAVA_CLIENT_SECRET }}/g' -e 's/SPORTTRACKS_CLIENT_ID/${{ secrets.SPORTTRACKS_CLIENT_ID }}/g' -e 's/SPORTTRACKS_CLIENT_SECRET/${{ secrets.SPORTTRACKS_CLIENT_SECRET }}/g' -e 's/RWGPS_APIKEY/${{ secrets.RWGPS_APIKEY }}/g' kubernetes-secrets.yml | ||
sed -i'' -e 's/tapiriik:latest/tapiriik:${{ github.sha }}/g' kubernetes.yml | ||
kubectl apply -f kubernetes-secrets.yml --namespace tapiriik | ||
kubectl apply -f kubernetes.yml --namespace tapiriik |
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
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