on: push jobs: deploy: runs-on: debian steps: - uses: actions/checkout@v1 - name: setup env run: | . ./.env || true if [ "${{ gitea.ref_name }}" == prod ] && [ -n "$PROD_URL" ]; then BASE_URL="$PROD_URL" else BASE_URL="${{ gitea.ref_name }}.$(tr / '\n' <<< "${{ gitea.repository }}" | tac | tr '\n' .)k8s.gmoker.com" fi cat <> .env BASE_URL="$BASE_URL" INSTANCE_NAME="${{ gitea.ref_name }}" EOF cat .env - uses: actions/k8sdeploy@v1 with: kubeconfig: "${{ secrets.K8S }}"