Skip to content

Commit

Permalink
k8s/deployment.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
echemmara authored Feb 6, 2025
1 parent 6b6ce43 commit bbbfe63
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/deploy-kubernetes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and deploy PHP app to Kubernetes

on:
push:
branches: [ "main" ]
workflow_dispatch:

env:
DOCKER_IMAGE_NAME: your-docker-image-name
DOCKER_IMAGE_TAG: latest

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_IMAGE_TAG }}

deploy:
needs: build
runs-on: ubuntu-latest

steps:
- name: Set up kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.18.0'

- name: Deploy to Kubernetes
run: |
kubectl apply -f k8s/deployment.yaml

0 comments on commit bbbfe63

Please sign in to comment.