name: Deploy
on:
  push:
    tags:
      - v*
jobs:
  build-and-push:
    name: Build and Push
    runs-on: ubuntu-latest
    env:
      REGISTRY: registry.digitalocean.com
      NAME: ghost/gscan
    steps:
      - uses: actions/checkout@v2

      - name: Get version
        run: echo "IMAGE_VERSION=$(git describe --tags)" >> $GITHUB_ENV

      - name: Publish to DigitalOcean Registry
        uses: elgohr/Publish-Docker-Github-Action@2.22
        with:
          registry: ${{ env.REGISTRY }}
          name: ${{ env.NAME }}
          dockerfile: .github/deploy/Dockerfile
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
          tags: "latest,${{ env.IMAGE_VERSION }}"

      - uses: matootie/dokube@v1.3.3
        with:
          personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
          clusterName: ${{ secrets.CLUSTER_NAME }}

      - name: Update deployment
        run: kubectl set image deployment/gscan gscan=${{ env.REGISTRY }}/${{ env.NAME }}:${{ env.IMAGE_VERSION }}

name: Deploy
on:
  push:
    tags:
      - v*
jobs:
  build-and-push:
    name: Build and Push
    runs-on: ubuntu-latest
    env:
      REGISTRY: registry.digitalocean.com
      NAME: ghost/gscan
    steps:
      - uses: actions/checkout@v2

      - name: Get version
        run: echo "IMAGE_VERSION=$(git describe --tags)" >> $GITHUB_ENV

      - name: Publish to DigitalOcean Registry
        uses: elgohr/Publish-Docker-Github-Action@2.22
        with:
          registry: ${{ env.REGISTRY }}
          name: ${{ env.NAME }}
          dockerfile: .github/deploy/Dockerfile
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
          tags: "latest,${{ env.IMAGE_VERSION }}"

      - uses: matootie/dokube@v1.3.4
        with:
          personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
          clusterName: ${{ secrets.CLUSTER_NAME }}

      - name: Update deployment
        run: kubectl set image deployment/gscan gscan=${{ env.REGISTRY }}/${{ env.NAME }}:${{ env.IMAGE_VERSION }}

Update matootie/dokube action to v1.3.4
Update matootie/dokube action to v1.3.4
