yw5ncom/.gitea/workflows/deploy.yaml
ange f23a6b672b
All checks were successful
/ deploy (push) Successful in 11s
fix: imagename
2024-08-17 23:25:58 +07:00

32 lines
918 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"
fi
REGISTRY="$(sed 's .*:// ' <<< ${{ gitea.server_url }})"
cat <<EOF >> .env
BASE_URL="$BASE_URL"
REGISTRY="$REGISTRY"
IMAGEAPP="$REGISTRY/${{ gitea.repository }}:${{ gitea.ref_name }}"
EOF
cat .env
- uses: actions/kaniko@v1
with:
password: "${{ secrets.PKGRW }}"
- uses: actions/k8sdeploy@v1
with:
kubeconfig: "${{ secrets.K8S }}"
registry_password: "${{ secrets.PKGRW }}"