ajustes novos
This commit is contained in:
parent
45d0cc595a
commit
a778c3216f
1 changed files with 6 additions and 7 deletions
|
|
@ -13,7 +13,6 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
# AJUSTE: Labels compatíveis com o runner ID 42 (Idle)
|
|
||||||
runs-on:
|
runs-on:
|
||||||
- self-hosted
|
- self-hosted
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
|
|
@ -22,8 +21,10 @@ jobs:
|
||||||
shell: sh
|
shell: sh
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# SUBSTITUÍDO: checkout@v4 por Git manual para evitar erro de falta de Node.js
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
git clone --depth 1 --branch dev https://${{ secrets.FORGEJO_TOKEN }}@pipe.gohorsejobs.com/${{ github.repository }}.git .
|
||||||
|
|
||||||
- name: Check Docker availability
|
- name: Check Docker availability
|
||||||
run: docker version
|
run: docker version
|
||||||
|
|
@ -55,7 +56,6 @@ jobs:
|
||||||
|
|
||||||
deploy-to-k3s:
|
deploy-to-k3s:
|
||||||
needs: build-and-push
|
needs: build-and-push
|
||||||
# AJUSTE: Labels compatíveis aqui também
|
|
||||||
runs-on:
|
runs-on:
|
||||||
- self-hosted
|
- self-hosted
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
|
|
@ -64,8 +64,10 @@ jobs:
|
||||||
shell: sh
|
shell: sh
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# SUBSTITUÍDO: checkout@v4 por Git manual
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
git clone --depth 1 --branch dev https://${{ secrets.FORGEJO_TOKEN }}@pipe.gohorsejobs.com/${{ github.repository }}.git .
|
||||||
|
|
||||||
- name: Install kubectl
|
- name: Install kubectl
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -81,10 +83,8 @@ jobs:
|
||||||
chmod 600 $HOME/.kube/config
|
chmod 600 $HOME/.kube/config
|
||||||
export KUBECONFIG=$HOME/.kube/config
|
export KUBECONFIG=$HOME/.kube/config
|
||||||
|
|
||||||
# Criar namespace se não existir
|
|
||||||
kubectl create namespace gohorsejobsdev --dry-run=client -o yaml | kubectl apply -f -
|
kubectl create namespace gohorsejobsdev --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
# Atualizar Secrets
|
|
||||||
kubectl -n gohorsejobsdev create secret docker-registry forgejo-registry \
|
kubectl -n gohorsejobsdev create secret docker-registry forgejo-registry \
|
||||||
--docker-server=${{ env.REGISTRY }} \
|
--docker-server=${{ env.REGISTRY }} \
|
||||||
--docker-username=${{ env.IMAGE_NAMESPACE }} \
|
--docker-username=${{ env.IMAGE_NAMESPACE }} \
|
||||||
|
|
@ -98,7 +98,6 @@ jobs:
|
||||||
--from-literal=DATABASE_URL="${{ vars.DATABASE_URL }}" \
|
--from-literal=DATABASE_URL="${{ vars.DATABASE_URL }}" \
|
||||||
--dry-run=client -o yaml | kubectl apply -f -
|
--dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
# Aplicar manifestos e atualizar imagens
|
|
||||||
kubectl apply -f k8s/dev/ -n gohorsejobsdev
|
kubectl apply -f k8s/dev/ -n gohorsejobsdev
|
||||||
|
|
||||||
kubectl -n gohorsejobsdev set image deployment/gohorse-backend-dev \
|
kubectl -n gohorsejobsdev set image deployment/gohorse-backend-dev \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue