-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(buildah): add github actions buildah docs
Signed-off-by: Evgeniy Frolov <[email protected]>
- Loading branch information
Showing
17 changed files
with
184 additions
and
5 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
11 changes: 11 additions & 0 deletions
11
...es/en/configurator/tab/ci/github-actions/simple/host-runner/linux/buildah/infra.md.liquid
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,11 @@ | ||
### Requirements | ||
|
||
- GitHub; | ||
|
||
- Host to run GitHub Runner | ||
|
||
### Installing the GitHub Runner | ||
|
||
Follow [official instructions](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners) to install the GitHub Runner on your dedicated host. | ||
|
||
{% include configurator/partials/ci/buildah_install.md.liquid %} |
8 changes: 8 additions & 0 deletions
8
.../en/configurator/tab/ci/github-actions/simple/host-runner/linux/buildah/project.md.liquid
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,8 @@ | ||
### Configuring CI/CD of the project | ||
|
||
This is how the repository that uses werf for build and deploy might look: | ||
|
||
{% tree_file_viewer '/examples/configurator/ci-cd/simple/github-actions/host-runner/linux/buildah' default_file='.github/workflows/prod.yml' %} | ||
|
||
Extras: | ||
* Add authorization options for `werf cleanup` in the container registry by following [instructions]({{ "/docs/v2/usage/cleanup/cr_cleanup.html#features-of-working-with-different-container-registries" | relative_url }}). |
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
11 changes: 11 additions & 0 deletions
11
...es/ru/configurator/tab/ci/github-actions/simple/host-runner/linux/buildah/infra.md.liquid
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,11 @@ | ||
### Требования | ||
|
||
* GitHub Actions; | ||
|
||
* Linux-хост для установки GitHub Runner | ||
|
||
### Установка GitHub Runner | ||
|
||
Установите GitHub Runner на выделенный для него хост, следуя [официальным инструкциям](https://docs.github.com/ru/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners). | ||
|
||
{% include configurator/partials/ci/buildah_install.md.liquid %} |
9 changes: 9 additions & 0 deletions
9
.../ru/configurator/tab/ci/github-actions/simple/host-runner/linux/buildah/project.md.liquid
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,9 @@ | ||
### Конфигурация CI/CD проекта | ||
|
||
Так может выглядеть репозиторий, использующий werf для сборки и развертывания: | ||
|
||
{% tree_file_viewer '/examples/configurator/ci-cd/simple/github-actions/host-runner/linux/buildah' default_file='.github/workflows/prod.yml' %} | ||
|
||
{% capture registry_guide_url %}/docs/v2/usage/cleanup/cr_cleanup.html#%D0%BE%D1%81%D0%BE%D0%B1%D0%B5%D0%BD%D0%BD%D0%BE%D1%81%D1%82%D0%B8-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%8B-%D1%81-%D1%80%D0%B0%D0%B7%D0%BB%D0%B8%D1%87%D0%BD%D1%8B%D0%BC%D0%B8-container-registries{% endcapture %} | ||
Дополнительно: | ||
* Добавьте для `werf cleanup` опции авторизации в container registry, следуя [инструкциям]({{ registry_guide_url | relative_url }}). |
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
20 changes: 20 additions & 0 deletions
20
...urator/ci-cd/simple/github-actions/host-runner/linux/docker/.github/workflows/cleanup.yml
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,20 @@ | ||
name: cleanup | ||
on: | ||
schedule: | ||
- cron: "0 3 * * *" | ||
|
||
jobs: | ||
cleanup: | ||
name: cleanup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: git fetch --prune --unshallow | ||
|
||
- uses: werf/actions/install@v2 | ||
|
||
- run: | | ||
source "$(werf ci-env github --as-file)" | ||
werf cleanup | ||
env: | ||
WERF_KUBECONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64 }} |
23 changes: 23 additions & 0 deletions
23
...figurator/ci-cd/simple/github-actions/host-runner/linux/docker/.github/workflows/prod.yml
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,23 @@ | ||
name: prod | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
prod: | ||
name: prod | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: werf/actions/install@v2 | ||
|
||
- run: | | ||
source "$(werf ci-env github --as-file)" | ||
werf converge | ||
env: | ||
WERF_ENV: prod | ||
WERF_KUBECONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64 }} |
16 changes: 16 additions & 0 deletions
16
...ator/ci-cd/simple/github-actions/host-runner/linux/docker/.helm/templates/deployment.yaml
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,16 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: app | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: app | ||
template: | ||
metadata: | ||
labels: | ||
app: app | ||
spec: | ||
containers: | ||
- name: app | ||
image: {{ .Values.werf.image.app }} |
10 changes: 10 additions & 0 deletions
10
...gurator/ci-cd/simple/github-actions/host-runner/linux/docker/.helm/templates/service.yaml
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,10 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: app | ||
spec: | ||
selector: | ||
app: app | ||
ports: | ||
- name: app | ||
port: 80 |
7 changes: 7 additions & 0 deletions
7
examples/configurator/ci-cd/simple/github-actions/host-runner/linux/docker/app/Dockerfile
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,7 @@ | ||
FROM node | ||
|
||
WORKDIR /app | ||
COPY . . | ||
RUN npm ci | ||
|
||
CMD ["node", "server.js"] |
12 changes: 12 additions & 0 deletions
12
...s/configurator/ci-cd/simple/github-actions/host-runner/linux/docker/app/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
examples/configurator/ci-cd/simple/github-actions/host-runner/linux/docker/app/package.json
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,8 @@ | ||
{ | ||
"name": "app", | ||
"version": "1.0.0", | ||
"main": "server.js", | ||
"scripts": { | ||
"start": "node server.js" | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
examples/configurator/ci-cd/simple/github-actions/host-runner/linux/docker/app/server.js
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,14 @@ | ||
const http = require('http'); | ||
|
||
const hostname = '127.0.0.1'; | ||
const port = 80; | ||
|
||
const server = http.createServer((req, res) => { | ||
res.statusCode = 200; | ||
res.setHeader('Content-Type', 'text/plain'); | ||
res.end('Hello World'); | ||
}); | ||
|
||
server.listen(port, hostname, () => { | ||
console.log(`Server running at http://${hostname}:${port}/`); | ||
}); |
6 changes: 6 additions & 0 deletions
6
examples/configurator/ci-cd/simple/github-actions/host-runner/linux/docker/werf.yaml
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,6 @@ | ||
configVersion: 1 | ||
project: myproject | ||
--- | ||
image: app | ||
dockerfile: Dockerfile | ||
context: ./app |