Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Failed to upload zip file" error #434

Closed
lcareto opened this issue Sep 13, 2024 · 1 comment
Closed

"Failed to upload zip file" error #434

lcareto opened this issue Sep 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@lcareto
Copy link

lcareto commented Sep 13, 2024

TL;DR

When uploading the code from source, getting the "The file at *** does not exist, or it is not a file" error while the zip file seems to exist after running ls -1 /tmp | grep .zip

Screenshot 2024-09-13 at 11 49 47 AM

Expected behavior

No zip file error

Observed behavior

Error: google-github-actions/deploy-cloud-functions failed with: failed to upload zip file: The file at *** does not exist, or it is not a file. ENOENT: no such file or directory, lstat '/home/runner/work/my-functions/my-functions/***

Action YAML

name: Deploy All Functions

on:
  push:
    branches:
      - main
jobs:

  deploy:
    runs-on: ubuntu-latest
    name: Deploy
    permissions:
      contents: "read"
      id-token: "write"
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js 22.8.0
        uses: actions/setup-node@v4
        with:
          node-version: 22.8.0
          cache: 'yarn'

      - name: Install
        run: yarn install

      - name: Build
        run: yarn run build

      - uses: google-github-actions/auth@v2
        with:
          credentials_json: ${{ secrets.GCP_SA_KEY }}

      - name: Deploy 
        timeout-minutes: 10
        continue-on-error: true
        uses: google-github-actions/deploy-cloud-functions@v3
        with:
          name: "my-function"
          runtime: "nodejs22"
          source_dir: "./functions/my-function"
          entry_point: "exec"
          max_instance_count: 3
          event_trigger_type: "google.pubsub.topic.publish"
          event_trigger_pubsub_topic: "projects/my-project/topics/my-topic"
        env:
          GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCP_SA_KEY }}

      - run: ls -1 /tmp | grep .zip

Log output

Cf. screenshot in TLDR

Additional information

Note my folder structure

/my-cloud-functions-repo
  /functions
    /my-function
      index.ts
      package.json
  tsconfig.json 
  package.json

the root package.json contains the following script and some shared dependencies

    "build": "tsc -b functions/*",
    "gcp-build":""

the my-function package json contains the following

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "noEmit": false,
    "outDir": "../../.",
  },
  "include": [
    "**/*.ts"
  ]
}

when running yarn run build at the root, the functions/my-function/index.js will be created

@lcareto lcareto added the bug Something isn't working label Sep 13, 2024
@sethvargo
Copy link
Member

Hi there - could you please provide the debug output for the complete GitHub Actions workflow run?

@sethvargo sethvargo closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants