nwtgck / actions-netlify Goto Github PK
View Code? Open in Web Editor NEW๐ Netlify deploy from GitHub Actions
License: MIT License
๐ Netlify deploy from GitHub Actions
License: MIT License
Deploys with github-action haven't deploy numbers (scope). Because of this, I cannot see the function logs from pull-requests deploys.
Look:
First row - usual build with Netlify, without gh-action. We can see number of this deploy (#5
), and link to logs looks like https://app.netlify.com/sites/your-project/functions/?scope=deploypreview:5
.
Second row - build with gh-actions, which hasn't number of deploy, and link to logs looks like https://app.netlify.com/sites/your-project/functions/
(without scope).
Is it possible to add a scope for deploys from gh-action?
Thank you!
I am attempting to run this action that has been in place, but appears to now be failing that credentials are not provided. The secret appears to be passed according to the logs:
This is my job for the relevant action:
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [setup, compile]
if: ${{ needs.setup.outputs.affected-deploys != '[]' }}
strategy:
matrix:
node: ['12.x']
deploy: ${{ fromJson(needs.setup.outputs.affected-deploys) }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set cache directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set up Node.js
uses: actions/setup-node@v2-beta
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
env:
CACHE_HIT: ${{ steps.yarn-cache.outputs.cache-hit }}
run: tools/scripts/yarn-ci.sh
- name: Restore compilation
uses: actions/download-artifact@v2
with:
name: dist
path: dist/
- run: touch dist/apps/${{ matrix.deploy.project }}/.prod.env
- run: touch dist/apps/${{ matrix.deploy.project }}/.env
- uses: c-py/action-dotenv-to-setenv@v1
with:
env-file: dist/apps/${{ matrix.deploy.project }}/.prod.env
env:
DOTENV_DEFAULT: dist/apps/${{ matrix.deploy.project }}/.env
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: dist/apps/${{ matrix.deploy.project }}
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-commit-comment: false
netlify-config-path: ./netlify.toml
functions-dir: dist/functions/
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Thanks for helping out!
Could it be that this GitHub action does not respect configurations in netlify.tom? For example I have defined following redirect rule
[[redirects]]
from = "https://me.com/*"
to = "https://www.me.io/:splat"
status = 301
force = true
This redirect worked as expected before I switched from using netlify-cli
in my npm scripts manually to this GitHub action ๐ค
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/[email protected]
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"
It is unclear what these options exactly do.
enable-pull-request-comment: true Comment on pull request (default: true)
enable-commit-comment: true Comment on GitHub commit (default: true)
enable-commit-status: true GitHub commit status (default: true)
overwrites-pull-request-comment: true Overwrites comment on pull request (default: true)
It would be helpful to go in detail to explain what happens, or link to relevant Netlify docs that probably already has some explanation.
any idea why env variable doesn't work when we are deploy preview?
I tried with nuxtjs/dotenv
and netlify.toml
but both options doesn't work ๐ข
here is the PR that I'm testing: shield-wall/myprofile#427
the variable is API_BASE_URL
I commented on the relevant PR yesterday, but in case it is missed I am raising an issue about it.
There was a typo when adding this feature, probably caused from copy/paste or autocomplete:
I'm not sure where in the UI the deployment description is visible at, but I do know how to view it via the Github API:
When using this feature, you can query deployments via CLI like so (example based on official github api docs):
curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/nwtgck/actions-netlify/deployments | less
Then look at the JSON data, something like:
"task": "deploy",
"original_environment": "pull request",
"environment": "pull request",
"description": null,
null
would incorrectly be the pull request
environment if you enabled the description
feature, instead of whatever value you assign the description.
It seems that there is a draft PR of netlify/js-client to support branch deploy: netlify/js-client#105.
It would be great to have that functionality in actions-netlify too once the above PR is released.
Currently, two comments are generated by repos.createCommitComment
and issues.createComment
.
e.g.
repos.createCommitComment
issues.createComment
The same comments confuse developers and overwhelm their email boxes.
I think it would be useful to be able to control the type of comments in the options.
I keep on running into the same issue and the error message is not helpful. All I get is this:
Run nwtgck/[email protected]
with:
publish-dir: ./bundling/bundles
production-branch: main
netlify-config-path: ./bundling/bundles/netlify.toml
env:
NETLIFY_SITE_ID: ***
NETLIFY_AUTH_TOKEN: ***
Error: Request path contains unescaped characters
How can I investigate what the problem is?
FYI there are no weird characters in the publish directoy:
Run find bundling
bundling
bundling/.gitignore
bundling/bundle-es6.ts
bundling/bundles
bundling/bundles/es6-dev.js
bundling/bundles/es6-v1.4.2.js
bundling/bundles/netlify.toml
bundling/netlify.toml
Be able to Deploy and Publish when using with a Release Trigger Event
Hi I tried to use it for a Release Action Event to Deploy + Publish in Netlify. But because the isDraft is always true, It will never publish.
on:
release:
types: [published]
The isDraft is always true when using with a Release Action Event because of this condition
const isDraft: boolean = context.ref !== refs/heads/${productionBranch}
I have a hotfix but I don't have permissions to push a branch and open a PR. Could you give me the permission? If not, can you add this to the conidtion
// isDraft = true WHEN
// github.ref != production_branch
// OR
// github.ref CONTAINS tags AND github.event.release.draft == false (This condition allow us to deploy + publish when it is on a release event)
const isDraft: boolean = context.ref !== `refs/heads/${productionBranch}` || (context.ref.includes('tags') && !context.ref.event.release.draft)
The contex.ref.event.release.draft I got from this doc: Events Object
And to check the context.ref for a release I just printed it with echo
This problem is only related to users deploying this repo.
Using npm run build
, you will have the following error.
[actions-netlify]$ npm run build
> [email protected] build /...
> tsc
node_modules/@actions/github/lib/github.d.ts:5:37 - error TS2507: Type 'typeof import("/.../node_modules/@octokit/rest/index")' is not a constructor function type.
5 export declare class GitHub extends Octokit {
~~~~~~~
node_modules/@actions/github/lib/github.d.ts:15:52 - error TS2694: Namespace '"/.../node_modules/@octokit/rest/index"' has no exported member 'Options'.
15 constructor(token: string, opts?: Omit<Octokit.Options, 'auth'>);
~~~~~~~
node_modules/@actions/github/lib/github.d.ts:16:31 - error TS2694: Namespace '"/.../node_modules/@octokit/rest/index"' has no exported member 'Options'.
16 constructor(opts: Octokit.Options);
~~~~~~~
src/main.ts:33:26 - error TS2339: Property 'issues' does not exist on type 'GitHub'.
33 await githubClient.issues.createComment({
~~~~~~
Found 4 errors.
You can directly modify ./node_modules/@actions/github/lib/github.d.ts
as follows.
- import Octokit from '@octokit/rest';
+ import {Octokit} from '@octokit/rest';
Hi, @nwtgck.
I want to use deploy_ssl_url
and ssl_url
in the other actions (e.g. send a message to a Slack channel), so I want to add it to outputs
for this action.
I will create a pull request if you accept this enhancement.
An example of implementation: https://github.com/kentaro-m/actions-netlify/commit/61f6a010e0ee71a3f4183b15168250be5c93a38b
the overwrite comment on PR uses a static lookup string. should it instead be based on the app id? This would allow to reuse the same comment with multiple deploys?
Could you please illustrate how you would use https://github.com/nwtgck/actions-netlify#outputs with https://github.com/marketplace/actions/page-speed-insights ?
Thank you!
Would it be possible to add an output containing the deploy id? It would be helpful to use the id later in the workflow. My use case is promoting to production only after the rest of the CI pipeline is complete.
Thanks!
Hi i'm using this action twice on the same PR to create two deploys, The problem is that both actions are editing the same comment and I end up with a single deploy preview url commented on the pull request.
Is there a way to have 2 comments?
I've got the following github actions setup:
name: Build and Deploy to Netlify
on:
push:
pull_request:
types: [opened, synchronize]
jobs:
build:
runs-on: ubuntu-18.04
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v2
- run: npm --version && node --version
- run: npm i
- run: npm run build
- run: npm install -D netlify-cli
- run: npx netlify-cli status
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- run: npx netlify-cli build
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './out_publish'
functions-dir: './out_functions'
production-branch: master
# github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: false
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
It it possible to instead somehow use the action to do the build... this setup that I have doesn't work btw due to some weird stuff going on with the netlify-cli which is really annoying!
Hi there,
I just found out that the plugin crashes and gives a strange error message when using TypeScript files within the functions
directory.
To test this I have created an empty index.ts
file within a functions
folder.
I also set functions-dir: './functions'
in the config.
When the Github Action is triggered I get the following error:
This problem does not occur when using only JS files.
Getting the error:
Promise timed out after 1200000 milliseconds
with v1.0.12. Here is my configuration:
- uses: nwtgck/[email protected]
with:
publish-dir: exports/html5
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
Here are my logs, though they're not entirely helpful:
2020-04-17T17:23:52.3852101Z ##[group]Run nwtgck/[email protected]
2020-04-17T17:23:52.3852244Z with:
2020-04-17T17:23:52.3852363Z publish-dir: exports/html5
2020-04-17T17:23:52.3852472Z env:
2020-04-17T17:23:52.3853290Z NETLIFY_AUTH_TOKEN: ***
2020-04-17T17:23:52.3853418Z NETLIFY_SITE_ID: ***
2020-04-17T17:23:52.3853529Z ##[endgroup]
2020-04-17T17:43:52.9631918Z ##[error]Promise timed out after 1200000 milliseconds
Thanks.
I'm using this to build deployment previews for pull requests. I have found that the GitHub Actions bot also puts an environment link on the PR whenever CI runs successfully. I find those links less distracting than having the bot actually comment a regular PR comment with the Netlify link. Hence, this is what I'm using as config:
https://github.com/grammyjs/website/blob/b3c08dedba6c2254912866c683621b847aa06084/.github/workflows/deno.yml#L32
However, even though the Netlify links are persistent, these environments seem to expire after a few hours (something between 1 and 5). Note that I don't mean old links after new activity. When the PR is inactive for a few hours, the bot somehow removes the link, AVE the message changes to "temporarily deployed to pull request". There's currently an example here: grammyjs/website#146
Is there any configuration I can use to prevent the bot from removing the links?
If there's no way, I'll just go back to having it comment regular text comments.
I am trying to use the action and it works great on Deploy Preview and Production.
But not in Staging branch, the issue is that although the deployment URL seems to be correct (since I use alias
option), the environment code is not updated.
This is what I set up in my project settings in Netlify:
This is the code of the action:
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ env.NETLIFY_SITE_ID }}
with:
publish-dir: ${{ env.WORKING_DIRECTORY }}/dist
production-branch: master
github-token: ${{ secrets.READ_GITHUB_TOKEN }}
github-deployment-environment: deploy preview
enable-commit-comment: false
deploy-message: ${{ env.SHORT_COMMIT_MESSAGE }}
alias: ${{ env.GIT_BRANCH }}
I tried a lot of options but nothing helped and I would be very happy if you could help or advice. Thanks
I have the following config in my GH action workflow:
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './storybook-static'
production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
and the action log outputs:
the last two lines state:
๐ Published on https://inventage-web-components.netlify.app/ as production
๐ Deployed on https://621e43c1990d8e4944cef5e9--inventage-web-components.netlify.app
However, the version at the production URL (https://inventage-web-components.netlify.app/) is never updated. The preview URL (https://621e43c1990d8e4944cef5e9--inventage-web-components.netlify.app) works fine and contains the latest version.
Builds are turned off on Netlify.
Am I doing something wrong? I cannot get the production URL to serve the latest version deployed.
To get this action to work with non-collaborator PRs I am following the advice to move job steps that require secrets into a separate workflow_run
workflow. I am providing the secrets to deploy, the build directory to publish and other field values that I can, this all works as expected.
The action is no longer able to add a comment, deployment environment status, check suite status (enable-commit-status), etc. enable-commit-comment
appears to be working, but it is taking the commit/SHA from my master branch that the workflow_run
is running from as it's not aware of my pull request anymore. This adds a deployment comment on a commit that is relevant to the pull request.
I use a different action to manage the PR comments. It has a number
option to provide PR number (used if no pull_request event is found):
- uses: marocchino/sticky-pull-request-comment@v2
with:
header: preview
number: ${{ env.PR_NUMBER }}
message: |
[Documentation preview for this PR](${{ steps.preview.outputs.deploy-url }}) is ready! :tada:
Built with commit: ${{ env.PR_HEADSHA }}
By providing the PR number (transferred via artifact), I am able to get my comments updated again.
Personally I don't need this feature, but it might be beneficial to other users of your action?
This action may benefit from a similar pr_number
feature? The only feature I am losing with my setup with workflow_run
is the deployment status updates on the pull request, but the PR comment fulfills the same purpose.
The deployment options are still valid, the project activity log can be viewed to see that a new deployment is added, and a CLI API query lists the deployment description. The only incorrect part is the commit (my master commit instead of actual PR commit (pull_request.head.sha
)), I have that information to provide the action with.
github-deployment-environment
is only used for assignment to deploying to a different environment?
I didn't seem to be able to run the workflow and provide the secrets to ENV vars that the action uses unless I specify the environment (netlify
) that I assigned the secrets to. However, that seems to cause an automated deploy status by myself (to which I can optionally provide a URL). I think this cancels the action that also attempts to deploy:
If I remove github-deployment-environment
, I get a similar result, but the action defaults to pull request
:
While I like the added deploy links to the related workflow runs that this action seems to be missing, I'd prefer only the github-actions[bot]
is running the deployment status update.
I'm not sure if this can be avoided, it seems to be caused by adding <job>.environment
(as below in config example) - but AFAIK the action doesn't seem to be able to access the secrets from ENV with github-deployment-environment: netlify
, nor can I pass those in as I had been doing prior to assigning the secrets to a deployment environment (that only seems to work if I explicitly set the environment
on the job
).
Relevant workflow snippet:
jobs:
preview:
name: 'Deploy Preview'
runs-on: ubuntu-20.04
# non-default environment contains the NETLIFY_* secrets below
# Note: This setting implicitly enables another deployment status?
environment:
name: netlify
url: ${{ steps.preview.outputs.deploy-url }} # required to add the "View Deployment" button (github action bot doesn't have this issue for it's own deploy status)
steps:
- uses: actions/checkout@v2
- name: 'Send preview build to Netlify'
id: preview
uses: nwtgck/[email protected]
timeout-minutes: 1
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-deployment-environment: netlify # otherwise defaults to `pull request`
enable-pull-request-comment: false
enable-commit-comment: false
enable-commit-status: false
- uses: marocchino/sticky-pull-request-comment@v2
with:
header: preview
message: |
[Documentation preview for this PR](${{ steps.preview.outputs.deploy-url }}) is ready! :tada:
Built with commit ${{ github.event.pull_request.head.sha }}
This issue isn't too important to resolve. I'm just trying out the environment feature, and seeing if I could get it to work smoothly with this action (not sure if I can avoid the duplicate status issue).
Perhaps instead of "Environment name of GitHub Deployments" for the github-deployment-environment
description, it could be "Environment name of GitHub Deployment target (default: pull request
)" or something along those lines?
I turned the Builds off in Netlify so that this Github Action can do my builds and deploys for me. However, the environment variables I set in Netlify do not work unless I let Netlify build for me. Is there a way to pass my site environment variables in this action? Has anyone else run into this issue.
My deploy-to-prod.yml
job:
name: Deploy to Netlify
on:
push:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hallee/[email protected]
with:
repo-token: ${{secrets.GITHUB_TOKEN}}
deploy-to-production:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Dependencies
run: yarn
- name: Build
run: yarn build
- name: Deploy
uses: nwtgck/[email protected]
with:
deploy-message: ${{ github.event.head_commit.message }}
enable-commit-comment: false
github-token: ${{ secrets.GITHUB_TOKEN }}
production-branch: master
production-deploy: true
publish-dir: 'build'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
Hey, I am trying to make Netlify to comment with link to preview on successufly GH action.
Link is generated but no comment is added.
Workflow here: https://github.com/NRCHKB/NRCHKB.github.io/actions/runs/1403407029/workflow
- name: Netlify Actions
uses: nwtgck/[email protected]
with:
publish-dir: './public'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN_NRCHKB_WIKI }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID_NRCHKB_WIKI }}
Action here: https://github.com/NRCHKB/NRCHKB.github.io/runs/4057360768?check_suite_focus=true
Run nwtgck/[email protected]
with:
publish-dir: ./public
env:
NETLIFY_AUTH_TOKEN: ***
NETLIFY_SITE_ID: ***
๐ Deployed on https://617dd6c925c04b114eb6a1fb--naughty-raman-c58f41.netlify.app
PR here: NRCHKB/NRCHKB.github.io#103
Hello, and thanks a lot for this awesome action!
I have started encountering this warning in my CI lately:
Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: nwtgck/actions-netlify
Is the update to Node 16 on the roadmap?
Awesome work on actions-netlify! I'm really loving this and I'm very thankful that this exists.
Is it possible to make a deployment the main one that appears in my-site.netlify.app
? When I try to set this up, the URL appears as <alias>--my-site.netlify.app
.
I'm still seeing this:
Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
Please update the following actions to use Node.js 16: nwtgck/[email protected]
After a previous issue about this was closed, someone posted another possible place this needs to be resolved, FWIW.
Hello,
Using this GitHub action is extremely dangerous, as you are using Personal access tokens.
Netlify does not have any granularity on permissions personal access tokens provide. This means that you are essentially deploying previews with access to the production environment.
If you are running previews on external PRs, anybody can modify the GH action workflow file and deploy it to your production website.
This cannot be solved unless Netlify provides permission selection on tokens.
We would like to clean up our old deploy previews by deleting them after the respective PR has merged. Does this action facilitate for this?
Currently dist/typescript
is automatically generated by npm run all
. I don't want to generate it because it causes type-definition's conflict problem when you run npm run build
again without rm -r ./dist
.
Except for one time, the action has timed out every time I've used it. Once I removed the timeout for the action and the entire job timed out after an hour. Every time there aren't any logged errors other than to note that it's timed out. It only worked one time. I saw that the Netlify CLI has a DEBUG
environment variable that enables more logging, so I tried adding that, but still no longing. Right now I have the timeout set to 3 minutes. How do I go about fixing this?
Run nwtgck/[email protected]
with:
publish-dir: ./public
production-branch: master
github-token: ***
deploy-message: Deploy from GitHub Actions
env:
NETLIFY_AUTH_TOKEN: ***
NETLIFY_SITE_ID: ***
DEBUG: *
##[error]The action has timed out.
First off, thanks for your work, it's been an immense help!
I've been using this Action for quite a while & noticed search indexers crawling URLs which looks surprisingly like mine. It takes the form of <ALPHANUMERIC-STRING>--jarmos.netlify.app
. Suffice to say it's hurting my indexing & SEO ratings due to duplicate entries in to the index.
After digging around a bit, I figured it's the Netlify which is deploying to more than one URL. I attached a screenshot highlighting the same. Refer to it below:
How do I enable to Action to only output the production URL & nothing else?
Here's the workflow file I'm using to build the site before deploying to Netlify:
name: Netlify Deploy
on:
push:
branches:
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.82.0"
- name: Generate Static Content
run: hugo --minify
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: "./public"
production-branch: dev
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deployed with GitHub Actions"
netlify-config-path: ./netlify.toml
github-deployment-environment: "Netlify Deploy"
enable-pull-request-comment: false
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
Am I doing something wrong or is it intended behaviour? If it's the latter, is there any way I could disable it?
Hi there!
The preview deploy has done and works, but I got a error with credentials, I thought fails-without-credentials: false
flag will help me, but..
config:
on:
pull_request:
branches:
- main
tags-ignore:
- 'v*.*'
jobs:
build:
runs-on: ubuntu-18.04
steps:
...build script
- name: Deploy to Netlify
uses: nwtgck/[email protected]
if: startsWith(github.head_ref, 'dependabot/*') == false
with:
publish-dir: 'storybook-static'
production-branch: main
github-token: Qvant-lab:${{ secrets.GITHUB_TOKEN }}
enable-commit-comment: true
overwrites-pull-request-comment: true
fails-without-credentials: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
on: push
works fine, trouble with pull_request
Repo:
https://github.com/Qvant-lab/qui-max
Thanks very much for this Action. I'm using it successfully for Netlify deploys.
In other workflows (in the lower case sense, not GHA sense), we surface the Netlify deploy URL via a commit status, which is really nice.
https://docs.netlify.com/site-deploys/notifications/#github-commit-statuses
(I guess that image shows using the "git commit checks" idea, but it's pretty similar to how "git commit status" approach looks and works.)
I like that this doesn't have notification consequences and doesn't clutter the PR conversation with its own comment.
Would you consider reporting the URL in that manner as an alternative to the current comment approach?
I am achieving this now by using your action and feeding its output into another action (I still have the comment turned on but I'll probably turn that off soon):
The action I'm using to add a status update to a commit is Sibz/github-status-action.
You can see all of this working together in this PR:
Would it be possible to write a small release note on every release? For example the latest release does not mention anything. So I had to look into the commit history to see that we now have a new production-deploy
input (which is great by the way!)
Hi!
I recently switched over all my functions to edge-functions, and now I'd like to automate their deployment. I haven't seen edge-functions mentioned anywhere here, is this possible at all with this action or are there plans to support them?
By the way, so far this action has worked flawlessly for me, really great tool, thanks for all the work!
Can we add input to enable/disable github deployment?
use case:
PR: #901
Wanted to drop a note that I ran into an issue with branch deploys that contain uppercased letters. For example, if I set an alias as alias: ISSUE-000
, the deployment shows as successful as https://issue-000--my-app.netlify.app
, but opening the URL returns a 404. If I lowercase the value first, then the deployment is actually successful. May be worth putting a note in the docs for this caveat.
What am I missing here? https://github.com/kaihendry/dabase.com/pull/1/checks?check_run_id=461522842
Hugo by default uses public for publish-dir so shouldn't it be using that?
Thank you!
when doing lots of commits to a WIP/non-draft PR, the number of deploy commen notifications adds up
I have a dbt
project with documentation I'd like to publish to Netlify.
By default, dbt
documentation is kept in /target (e.g. ~/my_project/target). I have therefore configured my Actions YAML file as:
name: Build and Deploy to Netlify
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './target'
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: false
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
On pushing to master I get the error:
Run nwtgck/[email protected]
with:
publish-dir: ./target
production-branch: master
github-token: ***
env:
NETLIFY_AUTH_TOKEN: ***
NETLIFY_SITE_ID: ***
Error: ENOENT: no such file or directory, lstat '/home/runner/work/my_project/my_project/target'
Can anyone point me in the right direction to resolve this?
https://github.com/kaihendry/dabase.com/runs/471466202 is the same as kaihendry/dabase.com#2 (comment)
I'm not sure how to address this.
When running the v1.2 action it does not fail when no credentials are provided which can happen under some circumstances because of dependabot e.g. (dependabot/dependabot-core#3253)
Sample run: https://github.com/gleichda/gleich.dev/runs/2492536703?check_suite_focus=true
Any upcoming support for deployment of files into netlify using the Large Media supported by Git-LFS (more on docs)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.