Search code examples
gitdockergithubyamlgithub-actions

Github Actions Failing


Github Actions were working in my repository till yesterday. I didnt make any changes in .github/workflows/dev.yml file or in DockerFile.

But, suddenly in recent pushes, my Github Actions fail with the error

Setup, Build, Publish, and Deploy

Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under
'/home/runner/work/_actions/GoogleCloudPlatform/github-actions/master/setup-gcloud'.
Did you forget to run actions/checkout before running your local
action?

May I know how to fix this

This is the sample .yml file I am using.

name: Release to Development

on:
  push:
    branches:
      - 'master'
jobs:
  setup-build-publish-deploy:
    name: Setup, Build, Publish, and Deploy
    runs-on: ubuntu-latest
    steps:

    - name: Checkout
      uses: actions/checkout@v2

    # Setup gcloud CLI
    - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
      with:
        version: '270.0.0'
        service_account_email: ${{ secrets.GCLOUD_EMAIL_DEV }}
        service_account_key: ${{ secrets.GCLOUD_AUTH_DEV }}

    # Configure docker to use the gcloud command-line tool as a credential helper
    - run: |
        # Set up docker to authenticate
        # via gcloud command-line tool.
        gcloud auth configure-docker

    # Build the Docker image
    - name: Build
      run: |
        docker build -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT"/"$IMAGE":"$GITHUB_SHA" \
          --build-arg GITHUB_SHA="$GITHUB_SHA" \
          --build-arg GITHUB_REF="$GITHUB_REF" .

    # Push the Docker image to Google Container Registry
    - name: Publish
      run: |
        docker push $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:$GITHUB_SHA

    # Set up kustomize
    - name: Set up Kustomize
      run: |
        curl -o kustomize --location https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64
        chmod u+x ./kustomize

    # Deploy the Docker image to the GKE cluster
    - name: Deploy
      run: |

Here's the snippet of error. enter image description here


Solution

  • I fixed it by changing uses value to

    • uses: google-github-actions/setup-gcloud@v0