bacongobbler / azure-blob-storage-upload

Uploads assets to Azure Blob Storage
Other
56 stars 25 forks source link

ERROR: incorrect usage: source must be an existing directory in CI #20

Closed Ibrahim-CloudLabs closed 2 years ago

Ibrahim-CloudLabs commented 2 years ago

The source directory is not detected when I build my source folder (dist) using Github actions. The targeted source directory gets created after my first job (Build on Windows) runs. It does find the source when I run (Build on Windows, creates a dist folder in ./solutions/app/) locally and upload it to repo.

name: Build Artifcats and Upload To Azure Blob Storage
on:
  push:
    branches:
      - main

jobs:
  build_on_win:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@master
      with:
        node-version: 14.2.0
Running Scripts**......... 

  upload:
    runs-on: ubuntu-latest
    needs: build_on_win   (Notice here I'm waiting for the artifacts to be built)
    steps:
      - uses: actions/checkout@v2
      - uses: bacongobbler/azure-blob-storage-upload@v1.2.0
        with:
          source_dir: ./solutions/app/dist
          container_name: 'app/latest'
          connection_string: .......
          sync: true
bacongobbler commented 2 years ago

That error comes directly from the Azure CLI. I’m not sure what you are proposing I should fix…

Ibrahim-CloudLabs commented 2 years ago

Im running a github actions download task that downloads an artifact to the following directory ./solutions/app/dist but not sure why source_dir is not found?

Response from artifact download Artifact dist was downloaded to /home/runner/work/CloudLocal/CloudLocal/solutions/app/dist

bacongobbler commented 2 years ago

Jobs can depend on one another, but that does not mean they share data. You will need to add an “upload artifact” and a “download artifact” step to archive and share data between jobs.

https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions

Ibrahim-CloudLabs commented 2 years ago

Sorry I was running the actions/checkout@v2 after downloading the artifact which deletes the repo 💯