action netlify cli
2.0.0
Esta ação permite ações arbitrárias com o Netlify CLI
Esta ação é um substituto para netlify/actions/cli@master
sem a camada docker que incorre em 30-50s extras de tempo de execução (o que parece resultar em um tempo médio de implantação de aproximadamente 1m 30s).
Essa ação geralmente é concluída em menos de um minuto (e, na melhor das hipóteses, 30 segundos).
NETLIFY_AUTH_TOKEN
- Obrigatório O token a ser usado para autenticação. Obtenha um com a IUNETLIFY_SITE_ID
- ID opcional do site da API do site no qual você deseja trabalhar. Obtenha-o na interface do usuário As seguintes saídas estarão disponíveis em uma etapa que usa esta ação:
NETLIFY_OUTPUT
, o stdout completo da execução do comando netlify
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 }}"
Se você encontrar algum, informe-o aqui para que possa ser esmagado.
MIT, consulte o arquivo LICENSE.