mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-08-23 22:26:29 +00:00
Add GitHub Actions docs
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user