29 lines
719 B
YAML
29 lines
719 B
YAML
name: Test and deploy
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
container: alpine/k8s:1.33.0
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: apk add --no-cache bash jq && ./test.sh
|
|
deploy:
|
|
if: github.event_name == 'push'
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
container: alpine/k8s:1.33.0
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: apk add --no-cache bash jq
|
|
- run: |
|
|
umask 077
|
|
echo "$KUBE_CONFIG_BASE64" | base64 -d > kubeconfig
|
|
export KUBECONFIG="$PWD/kubeconfig"
|
|
./deploy.sh
|
|
rm -f kubeconfig
|
|
env:
|
|
KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64 }}
|