actions
actions copied to clipboard
CLI Deploy failing on CDN diff
I am trying to build my site in Github Actions and deploy to Netlify using @netlify/actions and getting the following output:
Warning: JSONHTTPError: Not Found 404
Warning:
{
"name": "JSONHTTPError",
"status": 404,
"json": {
"code": 404,
"message": "Not Found"
}
}
JSONHTTPError: Not Found
at parseResponse (/usr/local/share/.config/yarn/global/node_modules/netlify/src/methods/response.js:12:11)
at runMicrotasks (<anonymous>)
at async callMethod (/usr/local/share/.config/yarn/global/node_modules/netlify/src/methods/index.js:38:26)
at async module.exports (/usr/local/share/.config/yarn/global/node_modules/netlify/src/deploy/index.js:78:16)
at async NetlifyAPI.deploy (/usr/local/share/.config/yarn/global/node_modules/netlify/src/index.js:93:12)
at async DeployCommand.run (/usr/local/share/.config/yarn/global/node_modules/netlify-cli/src/commands/deploy.js:177:17)
at async DeployCommand._run (/usr/local/share/.config/yarn/global/node_modules/@oclif/command/lib/command.js:43:20)
at async Config.runCommand (/usr/local/share/.config/yarn/global/node_modules/@oclif/config/lib/config.js:172:9)
at async Main.run (/usr/local/share/.config/yarn/global/node_modules/@oclif/command/lib/main.js:22:9)
Here's the YAML from my build config:
- name: Deploy to Netlify
uses: netlify/actions/cli@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
args: deploy --dir=public --prod
secrets: '["NETLIFY_AUTH_TOKEN", "NETLIFY_SITE_ID"]'
This is not able to be reproduced locally on my machine, where the deploy works fine.
Same issue here
@skylartaylor it works for me now. The issue in my workflow was that I forgot some environment variables to build my application:
- name: 📁 Generate static site
run: yarn generate
env:
BASE_URL: ${{ secrets.BASE_URL }}
CTF_CDA_ACCESS_TOKEN: ${{ secrets.CTF_CDA_ACCESS_TOKEN }}
CTF_ENVIRONMENT: ${{ secrets.CTF_ENVIRONMENT }}
CTF_SPACE_ID: ${{ secrets.CTF_SPACE_ID }}
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
- name: 🌍 Publish to Netlify
uses: netlify/actions/cli@master
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
with:
args: deploy --dir=dist --prod
secrets: '["NETLIFY_AUTH_TOKEN", "NETLIFY_SITE_ID"]'
Interesting! My site is building just fine, it’s just the deploy to Netlify that is failing. I’ll poke at the build some more though!