Skip to content

Commit

Permalink
chore(ci, docs): use only the install werf action (#751)
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeniy Frolov <evgeniy.frolov@flant.com>
Co-authored-by: Aleksei Igrychev <alexey.igrychev@flant.com>
  • Loading branch information
Fral738 and alexey-igrychev authored Nov 18, 2024
1 parent 8d74d4c commit ba196ae
Show file tree
Hide file tree
Showing 27 changed files with 738 additions and 572 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ jobs:
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow

- name: Install werf
uses: werf/actions/install@v2

- name: Cleanup
uses: werf/actions/cleanup@43075e4ab81952b181d33e125ef15b9c060a782e
run: |
. $(werf ci-env github --as-file)
werf cleanup
env:
WERF_LOG_VERBOSE: "on"
WERF_REPO_GITHUB_TOKEN: ${{ secrets.REGISTRY_CLEANUP_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/content_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
runs-on: ubuntu-latest-4-cores
timeout-minutes: 60
steps:
- name: Install werf
uses: werf/actions/install@v2

- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -38,6 +35,9 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install werf
uses: werf/actions/install@v2

- name: Check links
run: |
source "$(werf ci-env github --as-file)"
Expand Down
33 changes: 21 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,47 @@ jobs:
cd .werf/artifacts
bash generate_artifacts.sh
- name: Install werf
uses: werf/actions/install@v2

- name: Deploy to test
uses: werf/actions/converge@v2
if: contains(github.event.pull_request.labels.*.name, 'test website')
with:
env: test
kube-config-base64-data: ${{ secrets.KUBECONFIG_BASE64_DEV }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_NAMESPACE: "werfio-test"
WERF_RELEASE: "werfio-site-test"
WERF_LOG_VERBOSE: "on"
WERF_ENV: "test"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64_DEV }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy to stage
uses: werf/actions/converge@v2
if: contains(github.event.pull_request.labels.*.name, 'stage website')
with:
env: stage
kube-config-base64-data: ${{ secrets.KUBECONFIG_BASE64_DEV }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_NAMESPACE: "werfio-stage"
WERF_RELEASE: "werfio-site-stage"
WERF_LOG_VERBOSE: "on"
WERF_ENV: "stage"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64_DEV }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy to production
uses: werf/actions/converge@v2
if: github.ref == 'refs/heads/main'
with:
env: production
kube-config-base64-data: ${{ secrets.KUBECONFIG_BASE64_PROD }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_NAMESPACE: "werfio-production"
WERF_RELEASE: "werfio-site-production"
WERF_LOG_VERBOSE: "on"
WERF_ENV: "production"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64_DEV }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

notification:
name: Notification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@
> uses: actions/checkout@v3
> with:
> fetch-depth: 0
>
> - name: Install werf
> uses: werf/actions/install@v2
>
> - name: Build
> run: |
> . $(werf ci-env github --as-file)
> werf build
> env:
> WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
> WERF_REPO: "example.org/mycompany/myapp"
> GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
>
> - name: Build and Publish
> uses: werf/actions/build-and-publish@master
> with:
> kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
>
> deploy:
> name: Deploy
> converge:
> name: Converge
> needs: build-and-publish
> runs-on: ubuntu-latest
> steps:
Expand All @@ -30,12 +37,20 @@
> uses: actions/checkout@v3
> with:
> fetch-depth: 0
>
> - name: Deploy
> uses: werf/actions/deploy@v2
> with:
> env: production
> kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
>
> - name: Install werf
> uses: werf/actions/install@v2
>
> - name: Converge
> run: |
> . $(werf ci-env github --as-file)
> werf converge --require-built-images
> env:
> WERF_ENV: production
> WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
> WERF_REPO: "example.org/mycompany/myapp"
> GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
>
> ```
> {% endraw %}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ jobs:
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install werf
uses: werf/actions/install@v2
- name: Cleanup
uses: werf/actions/cleanup@v2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
run: |
. $(werf ci-env github --as-file)
werf cleanup
env:
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WERF_REPO_GITHUB_TOKEN: ${{ secrets.REGISTRY_CLEANUP_TOKEN }}
```
{% endraw %}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ converge:
with:
fetch-depth: 0
- name: Install werf
uses: werf/actions/install@v2
- name: Converge
uses: werf/actions/converge@v2
with:
env: ANY_ENV_NAME
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_SET_ENV_URL: "envUrl=ANY_ENV_URL"
WERF_ENV: ANY_ENV_NAME
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
{% endraw %}
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ jobs:
with:
fetch-depth: 0
- name: Install werf
uses: werf/actions/install@v2
- name: Converge
uses: werf/actions/converge@v2
with:
env: staging
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_ENV: "staging"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
WERF_SET_ENV_URL: "envUrl=http://staging-company.kube.DOMAIN"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
{% endraw %}

Expand Down Expand Up @@ -74,13 +79,18 @@ jobs:
with:
fetch-depth: 0
- name: Install werf
uses: werf/actions/install@v2
- name: Converge
uses: werf/actions/converge@v2
with:
env: production
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_ENV: "production"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
WERF_SET_ENV_URL: "envUrl=https://www.company.org"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
{% endraw %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ jobs:
with:
fetch-depth: 0
- name: Install werf
uses: werf/actions/install@v2
- name: Converge
uses: werf/actions/converge@v2
with:
env: staging
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_ENV: "staging"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64_DEV }}
WERF_SET_ENV_URL: "envUrl=http://staging-company.kube.DOMAIN"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
{% endraw %}

Expand Down Expand Up @@ -55,13 +61,18 @@ jobs:
with:
fetch-depth: 0
- name: Install werf
uses: werf/actions/install@v2
- name: Converge
uses: werf/actions/converge@v2
with:
env: production
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_ENV: "production"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64_DEV }}
WERF_SET_ENV_URL: "envUrl=https://www.company.org"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
{% endraw %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ jobs:
with:
fetch-depth: 0
- name: Install werf
uses: werf/actions/install@v2
- name: Converge
uses: werf/actions/converge@v2
with:
env: staging
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_ENV: "staging"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
WERF_SET_ENV_URL: "envUrl=http://staging-company.kube.DOMAIN"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
{% endraw %}

Expand Down Expand Up @@ -56,13 +61,18 @@ jobs:
with:
fetch-depth: 0
- name: Install werf
uses: werf/actions/install@v2
- name: Converge
uses: werf/actions/converge@v2
with:
env: production
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_ENV: "production"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
WERF_SET_ENV_URL: "envUrl=https://www.company.org"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
{% endraw %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ jobs:
with:
fetch-depth: 0
- name: Install werf
uses: werf/actions/install@v2
- name: Converge
uses: werf/actions/converge@v2
with:
env: staging
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_ENV: "staging"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
WERF_SET_ENV_URL: "envUrl=http://staging-company.kube.DOMAIN"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
{% endraw %}

Expand Down Expand Up @@ -57,13 +62,18 @@ jobs:
with:
fetch-depth: 0
- name: Install werf
uses: werf/actions/install@v2
- name: Converge
uses: werf/actions/converge@v2
with:
env: production
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_ENV: "production"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
WERF_SET_ENV_URL: "envUrl=https://www.company.org"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
{% endraw %}

Expand Down
Loading

0 comments on commit ba196ae

Please sign in to comment.