action netlify cli
2.0.0
이 작업을 수행하면 Netlify CLI를 통해 임의 작업이 가능해집니다.
이 작업은 30~50초의 추가 실행 시간을 발생시키는 docker 레이어가 없는 netlify/actions/cli@master
를 대체합니다(평균 배포 시간은 ~1m 30초인 것으로 보입니다).
이 작업은 일반적으로 1분 이내에 완료됩니다(가장 좋은 경우에는 30초).
NETLIFY_AUTH_TOKEN
- 필수 인증에 사용할 토큰입니다 . UI로 구매NETLIFY_SITE_ID
- 작업하려는 사이트의 선택적 API 사이트 ID UI에서 가져옵니다. 이 작업을 사용하는 단계에서는 다음 출력을 사용할 수 있습니다.
NETLIFY_OUTPUT
- netlify
명령 실행의 전체 stdout on : [push]
jobs :
publish :
runs-on : ubuntu-latest
steps :
# build your site for deployment... in this case the `public` folder is being deployed
- name : Publish
uses : South-Paw/action-netlify-cli@v2
id : netlify
with :
# be sure to escape any double quotes with a backslash
args : ' deploy --json --dir "./public" --message "draft [${{ github.sha }}]" '
env :
NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
# and access outputs in other steps with ${{ steps.netlify.outputs.OUTPUT_ID }}
on : [push]
jobs :
publish :
runs-on : ubuntu-latest
steps :
- name : Start deployment
uses : bobheadxi/deployments@v1
id : deployment
with :
env : production
step : start
# ... steps to build your site for deployment
- name : Deploy to Netlify
uses : South-Paw/action-netlify-cli@v2
id : netlify
with :
# note that the --json flag has been passed so we can parse outputs
args : deploy --json --prod --dir './public' --message 'production [${{ github.sha }}]'
env :
NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
- name : Finish deployment
uses : bobheadxi/deployments@v1
if : always()
with :
env : ${{ steps.deployment.outputs.env }}
step : finish
status : ${{ job.status }}
deployment_id : ${{ steps.deployment.outputs.deployment_id }}
env_url : ${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).url }}
--json
플래그 구문 분석 on : [push]
jobs :
publish :
runs-on : ubuntu-latest
steps :
# ... steps to build your site for deployment
- name : Deploy to Netlify
uses : South-Paw/action-netlify-cli@v2
id : netlify
with :
# note that the --json flag has been passed so we can parse outputs
args : deploy --json --prod --dir './public' --message 'production [${{ github.sha }}]'
env :
NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
# You can parse the `NETLIFY_OUTPUT` output with `fromJson` function for the following information:
- name : Parse NETLIFY_OUTPUT JSON
run : |
echo "The URL where the logs from the deploy can be found"
echo "${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).logs }}"
echo ""
echo "the URL of the draft site that Netlify provides"
echo "${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }}"
echo ""
echo "the URL of the "real" site, set only if `--prod` was passed"
echo "${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).url }}"
발견한 경우 여기에 신고하여 폐기할 수 있도록 하세요.
MIT, LICENSE 파일을 참조하세요.