fix: use ubuntu runner for deploy (has git)
This commit is contained in:
parent
6b6e3f0c15
commit
0d353037c2
1 changed files with 8 additions and 7 deletions
|
|
@ -57,21 +57,22 @@ jobs:
|
||||||
needs: [docker]
|
needs: [docker]
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: bitnami/kubectl:1.31
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
- name: Install kubectl
|
||||||
run: |
|
run: |
|
||||||
cd /tmp && git clone --depth=1 "https://djohn:${TOKEN}@code.core.ci/${{ github.repository }}.git" repo
|
curl -LO "https://dl.k8s.io/release/v1.31.0/bin/linux/amd64/kubectl"
|
||||||
|
chmod +x kubectl
|
||||||
|
sudo mv kubectl /usr/local/bin/
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
env:
|
env:
|
||||||
KUBECONFIG_DATA: ${{ secrets.KUBE_CONFIG }}
|
KUBECONFIG_DATA: ${{ secrets.KUBE_CONFIG }}
|
||||||
run: |
|
run: |
|
||||||
echo "$KUBECONFIG_DATA" | base64 -d > /tmp/kubeconfig
|
echo "$KUBECONFIG_DATA" | base64 -d > /tmp/kubeconfig
|
||||||
export KUBECONFIG=/tmp/kubeconfig
|
export KUBECONFIG=/tmp/kubeconfig
|
||||||
cd /tmp/repo/k8s/prod
|
cd k8s/prod
|
||||||
kubectl kustomize . | kubectl apply -f -
|
kubectl kustomize . | kubectl apply -f -
|
||||||
kubectl -n books set image deployment/books web=${{ env.REGISTRY }}/books:${{ github.sha }}
|
kubectl -n books set image deployment/books web=${{ env.REGISTRY }}/books:${{ github.sha }}
|
||||||
kubectl -n books rollout status deployment/books --timeout=120s
|
kubectl -n books rollout status deployment/books --timeout=120s
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue