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

Destination folder could be very helpful #21

Open
alexanderfanz opened this issue Dec 4, 2020 · 8 comments
Open

Destination folder could be very helpful #21

alexanderfanz opened this issue Dec 4, 2020 · 8 comments
Labels
documentation Improvements or additions to documentation

Comments

@alexanderfanz
Copy link

I have several sites in the same bucket (basically one site per environment), so every CloudFront looks at some folder in the bucket.
Will be helpful if we could parametrize the destination folder inside the bucket.

@alexanderfanz
Copy link
Author

I did a workaround for now:
bucket: ${{ secrets. S3_BUCKET }}/<folder_name>

@petermize2077
Copy link

petermize2077 commented Dec 22, 2020

I just tried this as well and it worked, but it still threw an error

Uploaded: ***/<my-special-path>/build/bundle.css
Uploaded: ***/<my-special-path>/index.html
Uploaded: ***/<my-special-path>/global.css
Uploaded: ***/<my-special-path>/build/bundle.js
Upload finished
InvalidBucket: Bucket names cannot contain forward slashes. Bucket: ***/<my-special-path>
    at Request.validateBucketName (/home/runner/.npm/_npx/2580/lib/node_modules/s3-deploy/node_modules/aws-sdk/lib/services/s3.js:228:30)
    at Request.callListeners (/home/runner/.npm/_npx/2580/lib/node_modules/s3-deploy/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/home/runner/.npm/_npx/2580/lib/node_modules/s3-deploy/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/home/runner/.npm/_npx/2580/lib/node_modules/s3-deploy/node_modules/aws-sdk/lib/request.js:688:14)
    at Request.transition (/home/runner/.npm/_npx/2580/lib/node_modules/s3-deploy/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/home/runner/.npm/_npx/2580/lib/node_modules/s3-deploy/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at Request.runTo (/home/runner/.npm/_npx/2580/lib/node_modules/s3-deploy/node_modules/aws-sdk/lib/request.js:408:15)
    at /home/runner/.npm/_npx/2580/lib/node_modules/s3-deploy/node_modules/aws-sdk/lib/request.js:797:12
    at new Promise (<anonymous>)
    at Request.promise (/home/runner/.npm/_npx/2580/lib/node_modules/s3-deploy/node_modules/aws-sdk/lib/request.js:783:12) {
  code: 'InvalidBucket',
  time: 2020-12-22T19:04:44.470Z
}

@LoganArnett
Copy link

@petermize2077 did you end your bucket name with / like ${{ secrets. S3_BUCKET }}/<folder_name>/ I just did this accidentally and got the same error but removing that last slash fixed it for me

@Reggionick
Copy link
Owner

Hi @alexanderfanz, couldn't this be the solution instead of a workaround? Due to the S3's folder logic (tags) I think that this could be a better solution intenda of having a destination folder param. What do you think?

I did a workaround for now:
bucket: ${{ secrets. S3_BUCKET }}/<folder_name>

@seadeep42
Copy link

Hi,
I was looking for the same and stumbled across this. I think it might be better to mention it as an example in the docs?

@shen-lin
Copy link

bucket: ${{ secrets. S3_BUCKET }}/<folder_name> is not working for me. Error: InvalidBucket: Bucket names cannot contain forward slashes.

What worked for me is the delete-removed parameter. In addition to the boolean value, import-io/s3-deploy's deleteRemoved parameter also takes glob pattern as input. The corresponding parameter in s3-deploy github action is delete-removed. It will only update content in the given folder with the following setting.

bucket: ${{ secrets.S3_BUCKET }}
delete-removed: <folder_name>/**

@Reggionick Reggionick added the documentation Improvements or additions to documentation label Feb 18, 2022
@dlbone
Copy link

dlbone commented Jun 12, 2023

I would like to use the src/ folder in my repo but have it delivered to the root of the bucket, any options for this?

@slayerjain
Copy link

slayerjain commented Oct 6, 2023

I just had the same problem. so I just structured my directory structure before moving. Eg: https://github.com/keploy/docs/blob/dd49612e11b98902a1f4396df455cd2ef7add62a/.github/workflows/main.yml#L38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

8 participants