nwtgck / actions-netlify

🚀 Netlify deploy from GitHub Actions
MIT License
324 stars 41 forks source link

Netlify preview build not using netlify.toml #720

Open Shaquu opened 2 years ago

Shaquu commented 2 years ago

Currently standard preview with comment to PR works. I have issues regarding using custom build command for preview. If successful urls on preview should consist of DEPLOY_URL (not the one configured in config files, I tested locally the same command and it worked).

gh action

      - name: Netlify Actions
        uses: nwtgck/actions-netlify@v1.2.3
        with:
          publish-dir: "./public"
          github-token: ${{ secrets.GITHUB_TOKEN }}
          netlify-config-path: ./netlify.toml
        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN_NRCHKB_WIKI }}
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID_NRCHKB_WIKI }}

netlify.toml

[context.deploy-preview]
command = "hugo -b $DEPLOY_URL"

[context.deploy-preview.environment]
HUGO_VERSION = "0.76"

Run https://github.com/NRCHKB/NRCHKB.github.io/commit/622caa8c8b06bc02eb6b5f16f1ceb0773a263141

nwtgck commented 2 years ago

I'm not sure the action supports the command. The configuration file is loaded by a function officially provided: https://github.com/nwtgck/actions-netlify/blob/99552499dc4207a31e262620f263e7cfdf39cf59/src/main.ts#L112

I'm not sure the action should support the command execution.

airtonix commented 2 years ago

why not? it's supported by the netlify cli