jakejarvis/s3-sync-action

Issue with SOURCE_DIR variable

Closed this issue · 3 comments

Hi, I am pushing a static generated site to S3. My whole project lives on github, but only one dir './output/'generated_html_css_etc actually needs to be synced to S3. I have tried several different ways to pass the SOURCE_DIR var but I keep getting github actions errors that it cannot find the dir. Below is my main.yml file with a few variable variations I have tried:

name: Push Website To S3
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: jakejarvis/s3-sync-action@master
      with:
        args: --acl public-read --follow-symlinks --delete --exclude '.git/*'
      env:
        AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_REGION: 'us-west-2'
        SOURCE_DIR: './output'

I have also tried:

SOURCE_DIR: './this_project_repo/output'
SOURCE_DIR: './../../output'
SOURCE_DIR: 'output'
SOURCE_DIR: '~/this_project_repo/output'

I'm pretty sure I am doing something silly, I looked at the entrypoint.sh and the conditional SOURCE_DIR:-. looks fine. The documentation says that './' is the git clone root, so I assumed './output' would have worked.

Thanks for the help!

My dumb fault... SOURCE_DIR: 'output' is the correct choice, there was another permissions issue with my bucket policy. https://stackoverflow.com/questions/36272286/getting-access-denied-when-calling-the-putobject-operation-with-bucket-level-per

Also getting a similar issue @kshannon. I'm getting 'The user-provided path 'dir' does not exist.' when it clearly does. What permissions did you need to change on your bucket?

@marklundin I believe this is the bucket in question for my personal site... its been a while. Here are the bucket permissions I set for a publicly accessible bucket:

image

and

Screen Shot 2022-09-27 at 4 54 02 PM

hope this helps. Cheers!