remix-run / grunge-stack

The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.
https://remix.run/stacks
MIT License
434 stars 95 forks source link

Fresh unaltered template will not deploy with Github Actions #155

Open patrickisgreat opened 1 year ago

patrickisgreat commented 1 year ago

Have you experienced this bug with the latest version of the template?

Yes

Steps to Reproduce

Relevant info: System is Ubuntu 22.04.2 LTS Node versions tried 16, and 18 Have also tried a fresh install of all deps with each, and updating outdated dependencies. To no avail. Interestingly, deployment via npx arc deploy works.

1.) npx create-remix --template your/repo 2.) create git repo 3.) GET AWS credentials and add them as secrets to the repo Actions secrets section 4.) npm run validate / install 5.) npx arc env --add --env (ARC_APP_SECRET) for each of the environments 6.) git init commit then push to repo 7.) Deployments kick off but fail with this error:


Run arc deploy --production -v --prune
  arc deploy --production -v --prune
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: 
         App ⌁ benteen-sotg-a0e3
      Region ⌁ us-west-2
     Profile ⌁ @aws profile / AWS_PROFILE not configured
     Version ⌁ Architect 10.13.1
         cwd ⌁ /home/runner/work/benteen-sotg/benteen-sotg

deploy failed! Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
    at IncomingMessage.<anonymous> (/opt/hostedtoolcache/node/16.20.1/x64/lib/node_modules/@architect/architect/node_modules/aws-sdk/lib/util.js:930:34)
    at IncomingMessage.emit (node:events:525:35)
    at IncomingMessage.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Error: Process completed with exit code 1.

Expected Behavior

Deployment proceeds as normal / expected via Github Actions.

Interestingly, deployment via npx arc deploy works.

Actual Behavior

Deployment fails in Github Actions Context.

MichaelDeBoey commented 1 year ago

@patrickisgreat I think you forgot to set the environment variables in GitHub Secrets

mcansh commented 1 year ago

I think you forgot to set the environment variables in GitHub Secrets

could probably detect these aren't set earlier on in the workflow and fail early with a clearer message

example: https://stackoverflow.com/a/72926257