when:
  - event: push
    branch: main

steps:
  - name: build_image
    image: docker:dind
    commands:
      - docker build -t scottyah/blog:latest .
      - docker push scottyah/blog:latest
      
  - name: deploy
    image: kubernetes/client:latest
    commands:
      - kubectl apply -f kubernetes/k8s.yaml
      - kubectl rollout status deployment/blog-dep