element/.gitea/workflows/deploy.yaml

24 lines
600 B
YAML
Raw Normal View History

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