some bugs fixed and unwanted files removed #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Pipeline | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker images | |
run: | | |
docker compose -f compose.prod.yaml build | |
docker compose -f compose.prod.yaml push | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- name: Save DigitalOcean kubeconfig | |
run: doctl kubernetes cluster kubeconfig save ${{ secrets.CLUSTER_NAME }} | |
- name: Deploy to DigitalOcean Kubernetes | |
run: | | |
kubectl apply -f k8s/ | |
kubectl get pods |