Skip to content

Commit

Permalink
Merge branch 'release/1.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Mar 17, 2020
2 parents 8326815 + ef1535b commit bc48b67
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 41 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- name: Create a simple Web site
run: mkdir -p deploy_dist && echo -e "<pre>$(date -u)\n$GITHUB_SHA\n$GITHUB_REF</pre>" > deploy_dist/index.html
- uses: ./
id: deploy-to-netlify
with:
publish-dir: './deploy_dist'
production-branch: master
Expand All @@ -26,3 +27,4 @@ jobs:
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- run: "echo 'outputs.deploy-url: ${{ steps.deploy-to-netlify.outputs.deploy-url }}'"
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [1.0.6] - 2020-03-17
### Changed
* Update dependencies

### Added
* Add `deploy-url` output [#48](https://github.com/nwtgck/actions-netlify/pull/48) by [@kentaro-m](https://github.com/kentaro-m)

## [1.0.5] - 2020-03-03
### Added
* Add `deploy-message` input [#40](https://github.com/nwtgck/actions-netlify/pull/40) by [@South-Paw](https://github.com/South-Paw)
Expand Down Expand Up @@ -47,7 +54,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
* Deploy to Netlify
* Comment on GitHub PR

[Unreleased]: https://github.com/nwtgck/actions-netlify/compare/v1.0.5...HEAD
[Unreleased]: https://github.com/nwtgck/actions-netlify/compare/v1.0.6...HEAD
[1.0.6]: https://github.com/nwtgck/actions-netlify/compare/v1.0.5...v1.0.6
[1.0.5]: https://github.com/nwtgck/actions-netlify/compare/v1.0.4...v1.0.5
[1.0.4]: https://github.com/nwtgck/actions-netlify/compare/v1.0.3...v1.0.4
[1.0.3]: https://github.com/nwtgck/actions-netlify/compare/v1.0.2...v1.0.3
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# actions-netlify
![build-test](https://github.com/nwtgck/actions-netlify/workflows/build-test/badge.svg)

GitHub Actions for deploying Netlify
GitHub Actions for deploying to Netlify

<img src="doc_assets/deploy-url-comment.png" width="650">

Expand Down Expand Up @@ -37,13 +37,26 @@ jobs:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
```
### Required parameters
### Required inputs and env
- `publish-dir` (e.g. "dist", "_site")
- `NETLIFY_AUTH_TOKEN`: [Personal access tokens](https://app.netlify.com/user/applications#personal-access-tokens) > New access token
- `NETLIFY_SITE_ID`: team page > your site > Settings > Site details > Site information > API ID
- NOTE: API ID is `NETLIFY_SITE_ID`.

### Optional parameters
### Optional inputs
- `production-branch` (e.g. "master")
- `github-token: ${{ secrets.GITHUB_TOKEN }}`
- `deploy-message` A custom deploy message to see on Netlify deployment (e.g. `${{ github.event.pull_request.title }}`)

### Outputs
- `deploy-url` A deployment URL generated by Netlify

## Build on local

```bash
npm ci
# NOTE: ./dist/typescript is generated automatically and causes type errors. (see: https://github.com/nwtgck/actions-netlify/issues/28)
rm -r dist
npm run all
```
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ inputs:
production-branch:
description: Production branch
required: false
outputs:
deploy-url:
description: Deploy URL
runs:
using: 'node12'
main: 'dist/index.js'
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181504,6 +181504,8 @@ function run() {
: `πŸŽ‰ Published on ${deploy.deploy.ssl_url} as production\nπŸš€ Deployed on ${deploy.deploy.deploy_ssl_url}`;
// Print the URL
process.stdout.write(`${message}\n`);
// Set the deploy URL to outputs for GitHub Actions
core.setOutput('deploy-url', isDraft ? deploy.deploy.deploy_ssl_url : deploy.deploy.ssl_url);
// Get GitHub token
const githubToken = core.getInput('github-token');
if (githubToken !== '') {
Expand Down
81 changes: 49 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "actions-netlify",
"version": "1.0.5",
"version": "1.0.6",
"private": true,
"description": "GitHub Actions for Netlify",
"main": "lib/main.js",
Expand Down Expand Up @@ -29,13 +29,13 @@
"netlify": "^3.1.0"
},
"devDependencies": {
"@types/jest": "^25.1.3",
"@types/node": "^12.12.29",
"@typescript-eslint/parser": "^2.22.0",
"@types/jest": "^25.1.4",
"@types/node": "^12.12.30",
"@typescript-eslint/parser": "^2.23.0",
"@zeit/ncc": "^0.21.1",
"eslint": "^5.16.0",
"eslint-plugin-github": "^2.0.0",
"eslint-plugin-jest": "^23.8.1",
"eslint-plugin-jest": "^23.8.2",
"jest": "^25.1.0",
"jest-circus": "^25.1.0",
"js-yaml": "^3.13.1",
Expand Down
6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ async function run(): Promise<void> {
// Print the URL
process.stdout.write(`${message}\n`)

// Set the deploy URL to outputs for GitHub Actions
core.setOutput(
'deploy-url',
isDraft ? deploy.deploy.deploy_ssl_url : deploy.deploy.ssl_url
)

// Get GitHub token
const githubToken = core.getInput('github-token')
if (githubToken !== '') {
Expand Down

4 comments on commit bc48b67

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.