synapse/.gitea/workflows/deploy.yaml

26 lines
673 B
YAML

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"
SERVER_NAME="$BASE_URL"
fi
cat <<EOF >> .env
BASE_URL="$BASE_URL"
SERVER_NAME="$SERVER_NAME"
EOF
cat .env
- uses: actions/k8sdeploy@v1
with:
kubeconfig: "${{ secrets.K8S }}"