Add GitHub Actions docs

This commit is contained in:
Stefan Prodan
2018-10-26 15:30:36 +03:00
parent 8013c0bed0
commit 08a26cef24
2 changed files with 37 additions and 0 deletions
+1
View File
@@ -48,3 +48,4 @@ Web API:
* [Expose Kubernetes services over HTTPS with Ngrok](docs/6-ngrok.md)
* [A/B Testing with Ambassador API Gateway](docs/5-canary.md)
* [Canary Deployments with Istio](docs/7-istio.md)
* [GitHub Actions CI demo](docs/8-gh-actions.md)
+36
View File
@@ -0,0 +1,36 @@
# GitHub Actions
Create a private repository named `demo-app` on GitHub and navigate to Settings/Secrets and add the following secrets:
* `DOCKER_IMAGE` eg stefanprodan/demo-app
* `DOCKER_USERNAME` eg stefanprodan
* `DOCKER_PASSWORD` eg my-docker-hub-pass
Install podinfo CLI:
```bash
go get -u github.com/stefanprodan/k8s-podinfo/cmd/podcli
```
If you don't have golang installed go to the
[release page](https://github.com/stefanprodan/k8s-podinfo/releases), download the latest podcli release and add it to your path.
Clone your private repository (preferable in your `$GOPATH`) and initialize podinfo.
```bash
git clone https://github.com/stefanprodan/demo-app
cd demo-app
podcli code init demo-app --git-user=stefanprodan --version=v1.3.0
```
The above command does the following:
* downloads podinfo source code v1.3.0 from GitHub
* replaces golang import with your git username and project name
* commits and pushes the code to GitHub
When the code init command finishes, GitHub will test, build and push a Docker image
`${DOCKER_IMAGE}:${GIT-BRANCH}-${GIT-SHORT-SHA}` to your Docker Hub account.
If you create a GitHub release a Docker image with the format `${DOCKER_IMAGE}:${GIT-TAG}` will be published to Docker Hub.