synapse/.gitea/workflows/deploy.yaml

26 lines
673 B
YAML
Raw Permalink Normal View History

2024-05-01 09:29:32 +00:00
on: push
jobs:
2024-05-01 10:04:16 +00:00
deploy:
2024-05-01 09:29:32 +00:00
runs-on: debian
steps:
- uses: actions/checkout@v1
- name: setup env
run: |
2024-05-02 15:31:54 +00:00
. ./.env || true
2024-05-01 10:04:16 +00:00
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"
2024-05-17 13:02:20 +00:00
SERVER_NAME="$BASE_URL"
2024-05-01 10:04:16 +00:00
fi
2024-05-01 09:29:32 +00:00
cat <<EOF >> .env
2024-05-01 10:04:16 +00:00
BASE_URL="$BASE_URL"
2024-05-17 13:02:20 +00:00
SERVER_NAME="$SERVER_NAME"
2024-05-01 09:29:32 +00:00
EOF
cat .env
- uses: actions/k8sdeploy@v1
with:
kubeconfig: "${{ secrets.K8S }}"