-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (41 loc) · 1.97 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
env:
KUBECONFIG: /tmp/github-ci.kubeconfig
REGISTRY: registry.cloudscale-lpg-2.appuio.cloud
TEST_DOMAIN: apps.cloudscale-lpg-2.appuio.cloud
jobs:
build:
environment: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
KUBECONFIG_DATA: "${{ secrets.KUBECONFIG_TEST }}"
- uses: ./.github/actions/build
with:
IMGNAME: "${{ env.CI_PROJECT_NAME }}"
REGISTRY: "${{ env.REGISTRY }}"
- env:
NEWLINE: |2+
name: k8ify preview
run: |
jq -r 'try to_entries | map("\(.key)=\(.value|tostring|tojson)") | .[]' > .composeenv <<'EOF' ${{ env.NEWLINE }}${{ toJson(vars) }}${{ env.NEWLINE }}EOF
jq -r 'try to_entries | map("\(.key)=\(.value|tostring|tojson)") | .[]' >> .composeenv <<'EOF' ${{ env.NEWLINE }}${{ toJson(secrets) }}${{ env.NEWLINE }}EOF
docker run -v "${PWD}:/data" -w /data --env-file <(env) ghcr.io/vshn/k8ify:latest /bin/k8ify test ${CI_COMMIT_REF_SLUG} --shell-env-file .composeenv --modified-image '${{ env.NAMESPACE }}/${{ env.CI_PROJECT_NAME }}:${{ env.CI_COMMIT_REF_SLUG }}'
rm .composeenv
kubectl diff -f manifests/ || true
- env:
NEWLINE: |2+
name: k8ify deploy
run: |
jq -r 'try to_entries | map("\(.key)=\(.value|tostring|tojson)") | .[]' > .composeenv <<'EOF' ${{ env.NEWLINE }}${{ toJson(vars) }}${{ env.NEWLINE }}EOF
jq -r 'try to_entries | map("\(.key)=\(.value|tostring|tojson)") | .[]' >> .composeenv <<'EOF' ${{ env.NEWLINE }}${{ toJson(secrets) }}${{ env.NEWLINE }}EOF
docker run -v "${PWD}:/data" -w /data --env-file <(env) ghcr.io/vshn/k8ify:latest /bin/k8ify test ${CI_COMMIT_REF_SLUG} --shell-env-file .composeenv --modified-image '${{ env.NAMESPACE }}/${{ env.CI_PROJECT_NAME }}:${{ env.CI_COMMIT_REF_SLUG }}'
rm .composeenv
kubectl apply -f manifests/
name: Build and deploy to test
"on":
push:
branches:
- "[A-Z]+-**"
workflow_dispatch: {}