Skip to content

Merge pull request #296 from alwinsimon/v1 #2

Merge pull request #296 from alwinsimon/v1

Merge pull request #296 from alwinsimon/v1 #2

# ========================================= CD - Deploy - Payments Service =========================================
name: CD - Deploy - Payments Service
on:
push:
branches:
- production
paths:
- "payments/**"
jobs:
Payments-Service-CD-Pipeline:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Build Image and push to Docker registry
- run: cd payments && docker build -t alwinsimon/bookmyseat-payments .
- run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push alwinsimon/bookmyseat-payments
# Restart Deployment in K8s cluster deployed in Digital Ocean
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- run: doctl kubernetes cluster kubeconfig save ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- run: kubectl rollout restart deployment payments-depl