Skip to content

Deploy Service Eat

Deploy Service Eat #10

name: Deploy Service Eat
on:
workflow_run:
workflows: ["Rust-eat"]
types:
- completed
workflow_dispatch:
jobs:
build-push-and-deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag d3spina/t-web-800:eat-latest
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push the Docker image
run: docker push d3spina/t-web-800:eat-latest
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Deploy to Kubernetes
run: |
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
kubectl rollout status deployment/eat -n eat