Add Kubernetes deploy step
This commit is contained in:
parent
735eacc622
commit
c7a83a7375
2 changed files with 24 additions and 3 deletions
8
.github/workflows/deploy.yaml
vendored
8
.github/workflows/deploy.yaml
vendored
|
|
@ -39,3 +39,11 @@ jobs:
|
|||
- name: Deploy to Kubernetes
|
||||
run: |
|
||||
kubectl set image deployment/homepage homepage=ghcr.io/${{ github.repository }}:latest -n web
|
||||
|
||||
- name: Set up kubeconfig
|
||||
run: |
|
||||
mkdir -p ~/.kube
|
||||
echo "${{ secrets.KUBECONFIG_BASE64 }}" | base64 -d > ~/.kube/config
|
||||
chmod 600 ~/.kube/config
|
||||
env:
|
||||
KUBECONFIG: ~/.kube/config
|
||||
|
|
|
|||
19
.github/workflows/docker.yml
vendored
19
.github/workflows/docker.yml
vendored
|
|
@ -22,6 +22,19 @@ jobs:
|
|||
|
||||
- name: Build and Push Docker Image
|
||||
run: |
|
||||
IMAGE=ghcr.io/${{ github.repository }}
|
||||
docker build -t $IMAGE:latest .
|
||||
docker push $IMAGE:latest
|
||||
IMAGE="ghcr.io/${{ github.repository }}"
|
||||
docker build -t "$IMAGE:latest" .
|
||||
docker push "$IMAGE:latest"
|
||||
|
||||
- name: Set up Kubeconfig
|
||||
run: |
|
||||
mkdir -p ~/.kube
|
||||
echo "${{ secrets.KUBECONFIG_BASE64 }}" | base64 -d > ~/.kube/config
|
||||
chmod 600 ~/.kube/config
|
||||
env:
|
||||
KUBECONFIG: ~/.kube/config
|
||||
|
||||
- name: Deploy to Kubernetes
|
||||
run: |
|
||||
IMAGE="ghcr.io/${{ github.repository }}"
|
||||
kubectl set image deployment/homepage homepage=$IMAGE:latest -n web
|
||||
|
|
|
|||
Loading…
Reference in a new issue