8989 if : github.event_name == 'push' || github.event.inputs.nugetdeploy == 'true'
9090 runs-on : ${{ 'ubuntu-latest' }}
9191 steps :
92+ - name : Criar Deployment
93+ id : create_deployment
94+ run : |
95+ curl -X POST \
96+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
97+ -H "Accept: application/vnd.github.v3+json" \
98+ -d '{
99+ "ref": "${{ github.ref }}",
100+ "environment": "NuGet",
101+ "description": "Deploy de pacotes para o NuGet",
102+ "required_contexts": []
103+ }' \
104+ https://api.github.com/repos/${{ github.repository }}/deployments
105+
92106 - name : Download Artifacts
93107 uses : actions/download-artifact@v4
94108 with :
@@ -145,3 +159,17 @@ jobs:
145159 uses : Ilshidur/action-discord@master
146160 with :
147161 args : ' Lançado Zeus DFe.NET versão {{ DISCORD_MENSAGEM }} no Nuget! Acesse: https://www.nuget.org/profiles/ZeusAutomacao'
162+
163+ - name : Atualizar Status do Deployment
164+ if : success()
165+ run : |
166+ curl -X POST \
167+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
168+ -H "Accept: application/vnd.github.v3+json" \
169+ -d '{
170+ "state": "success",
171+ "environment": "NuGet",
172+ "description": "Deploy concluído com sucesso.",
173+ "log_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
174+ }' \
175+ https://api.github.com/repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.id }}/statuses
0 commit comments