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.
GitHub uses the exit code to set the action's check run status, which can be success or failure . The action completed successfully and other tasks that depends on it can begin. Any other exit code indicates the action failed. When an action fails, all concurrent actions are canceled and future actions are skipped.
Job execution time - Each job in a workflow can run for up to 6 hours of execution time. If a job reaches this limit, the job is terminated and fails to complete. Workflow run time - Each workflow run is limited to 35 days. If a workflow run reaches this limit, the workflow run is cancelled.
GitHub Actions usage is free for both public repositories and self-hosted runners. For private repositories, each GitHub account receives a certain amount of free minutes and storage, depending on the product used with the account.
You can configure a GitHub Actions workflow to be triggered when an event occurs in your repository, such as a pull request being opened or an issue being created. Your workflow contains one or more jobs which can run in sequential order or in parallel.
GitHub displays statuses to indicate passing or failing actions. GitHub uses the exit code to set the action's check run status, which can be success or failure. The action completed successfully and other tasks that depends on it can begin. Any other exit code indicates the action failed.
GitHub Actions: Skipping a step without failing | An independent mind… I wanted to have a GitHub Action step run that might fail, but if it failed the rest of the steps should still execute and the overall run should be treated as a success. Skip to primary navigation Skip to content Skip to footer An independent mind... Portfolio Posts Categories
GitHub Actions Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you'd like, including CI/CD, and combine actions in a completely customized workflow.
Restarting the GitHub Actions workflow can be achieved by using the workflow_dispatch event trigger. Info Events that trigger workflows First of all, you need to add the workflow_dispatch event trigger to your GitHub Actions workflow. Info Check out the doctor flow here: release.yml on GitHub.
I fixed it by changing uses
value to
uses: google-github-actions/setup-gcloud@v0
There are some changes visit here for details https://github.com/google-github-actions/setup-gcloud#use-google-github-actionssetup-gcloud
steps:
id: gcloud
uses: google-github-actions/setup-gcloud@master
or
steps:
id: deploy
uses: google-github-actions/deploy-cloudrun@main
For anyone wondering why this is not working anymore, check this notice: https://github.com/google-github-actions/setup-gcloud#-notice
Now each action has its own repo, so you have to change the way you reference Google Cloud Platform actions in your yaml:
steps:
- id: gcloud
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
+ uses: google-github-actions/setup-gcloud@master
I have faced the similar error. When I was trying to call my local workflow from steps level. Apparently GitHub actions support local workflow call from jobs level. I could not call from inside steps.
name: Build and Deploy
on:
push:
branches: [dev]
permissions:
id-token: write
contents: read
jobs:
build-and-publish:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: test local call from steps # this do not work
if: github.ref_name == 'dev'
uses: ./.github/workflows/deploy.yml # this is from steps level
with:
devops-bucket: bucket-name
role: iam role for the job
dev: # this worked well
if: github.ref_name == 'dev'
uses: ./.github/workflows/deploy.yml # this is jobs level
with:
devops-bucket: bucket-name
role: iam role for the job
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With