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

Issue with folder option? #63

Open
seadeep42 opened this issue Apr 6, 2022 · 12 comments
Open

Issue with folder option? #63

seadeep42 opened this issue Apr 6, 2022 · 12 comments
Labels
help wanted Extra attention is needed

Comments

@seadeep42
Copy link

seadeep42 commented Apr 6, 2022

Hi,

I have a monorepo setup with the folder at packages/dashboard/build.
But it seems to be deploying packages/dashboard for some reason since yesterday.
And I haven't updated anything in the past few days

@Reggionick
Copy link
Owner

Which version are you using?

@seadeep42
Copy link
Author

Thank you for the quick response.

reggionick/s3-deploy@v3

@Reggionick
Copy link
Owner

We haven't made any change on the v3 of the action. Could you double check on your side?

@callum-hyland
Copy link

Same issue for me, no code changed in the action for months but randomly it's started pushing the root folder. Could be an internal Github change?

- name: Deploy
        uses: reggionick/s3-deploy@v3
        with:
          folder: ./interface/build

Screenshot 2022-04-08 at 09 50 34

@ajainvivek
Copy link

Same issue for me. no code changes pushing the root folder.

@ajainvivek
Copy link

@Reggionick Any updates on this issue?

@Reggionick
Copy link
Owner

No, I can't work on this right now.. But any PR is welcome!

@Reggionick Reggionick added the help wanted Extra attention is needed label Apr 14, 2022
@palashkaria
Copy link

palashkaria commented Apr 18, 2022

This caused our prod dashboard to go down, we have migrated away from using GH actions to amplify for this reason. Would recommend anyone else using this to pin the version that works.
Update: looks like it's not even a version issue; The code has had no changes for months, but our builds worked on 31st March, broke on 14th April. That's odd, and I'm unable to figure out what actually happened

@seadeep42
Copy link
Author

I'm not sure if this is the cause but in my case, the only change I notice is the Github job runner version change from 2.289.1 to 2.289.2. It's currently at version 2.290.1 but the issue seems to persist

Screenshot 2022-04-18 at 7 12 53 PM

@tanmoyAtb
Copy link

Same issue here. We had to move to manual deploys for the time being.

@seadeep42
Copy link
Author

Hi,

For anyone else who came across this. I couldn't solve it with the action but found an alternate to fix it.
Edited my action yml file to replace this with aws cli.

      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: ${{ secrets.AWS_REGION }}

      - name: Deploy dashboard to bucket
        run: aws s3 sync ./packages/dashboard/build s3://<bucket-name>/<folder-path>/

      - name: Invalidate dashboard cloudfront
        run: aws cloudfront create-invalidation --distribution-id <dist-id> --paths "/<invalidation-path>/*"

@Akuukis
Copy link

Akuukis commented Dec 3, 2022

The root cause

In simplified form, this library calls npx --cwd ./ via exec.exec(command, [], { cwd }), where's npx "walks" upwards to first package.json and uses that folder as cwd instead, partially ignoring the set cwd within exec. For a reason the upstream docs mention setting cwd: s3-deploy './dist/**' --cwd './dist/' ....

See also npm/cli#1975

Solution

don't use npx or don't hardcode npx --cwd ./.

Workaround

None I can think of, use either upstream instead or aws cli directly as in the comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants