From 2fdd873ed083264cb3ed16ebb9beca46ebcd3b06 Mon Sep 17 00:00:00 2001 From: azaiko-akveo <102226752+azaiko-akveo@users.noreply.github.com> Date: Thu, 28 Apr 2022 11:45:48 +0300 Subject: [PATCH] feat(deploy): demo enable gh actions manual trigger (#5932) * feat(deploy): enable manual triggering * fix(deploy): use the default azure/CLI version * doc(deploy): update action trigger guid * feat(deploy): enable manual triggering for docs Co-authored-by: artem.zaiko.ext --- .github/workflows/ACTION_TRIGGER_GUIDE.md | 23 ++++++++++++++--------- .github/workflows/azureCliDeploy.yml | 1 - .github/workflows/docsDeploy.yml | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ACTION_TRIGGER_GUIDE.md b/.github/workflows/ACTION_TRIGGER_GUIDE.md index b25cb9a7..cdd5e846 100644 --- a/.github/workflows/ACTION_TRIGGER_GUIDE.md +++ b/.github/workflows/ACTION_TRIGGER_GUIDE.md @@ -1,13 +1,18 @@ ### Actions deploy guide -In order to trigger workflow action you should execute the following curl: +In order to trigger workflow action you should execute the following curl ([docs](https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event)): -`curl -H "Accept: application/vnd.github.everest-preview+json" \` -`-H "Authorization: token " \` -`--request POST \` -`--data '{"event_type": ""}' \` -`https://api.github.com/repos/akveo/ngx-admin/dispatches` +``` +curl \ + -X POST \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Authorization: token " \ + https://api.github.com/repos/akveo/ngx-admin/actions/workflows//dispatches \ + -d '{"ref":"","inputs":{"name":"Mona the Octocat","home":"San Francisco, CA"}}' +``` -This curl expects two input parameters: -- `ACCESS_TOKEN`: A personal access token. Creating a [personal access token guide](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) -- `ACTION`: action to trigger ('deploy-docs', 'deploy-to-demo') +Parameters: + +- `WORKFLOW_ID` - the workflow id or its file name (e.g. `azureCliDeploy.yml`) +- `ACCESS_TOKEN`: A personal access token. Creating a [personal access token guide](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) +- `REF`: Required. The git reference for the workflow. The reference can be a branch or tag name. ('demo') diff --git a/.github/workflows/azureCliDeploy.yml b/.github/workflows/azureCliDeploy.yml index 050f84f1..3918d275 100644 --- a/.github/workflows/azureCliDeploy.yml +++ b/.github/workflows/azureCliDeploy.yml @@ -29,7 +29,6 @@ jobs: - name: Upload to blob storage uses: azure/CLI@v1 with: - azcliversion: 2.0.72 inlineScript: | az storage blob upload-batch -d '$web' -s dist --account-name ngxadmin --debug diff --git a/.github/workflows/docsDeploy.yml b/.github/workflows/docsDeploy.yml index 4d664a00..6ff23211 100644 --- a/.github/workflows/docsDeploy.yml +++ b/.github/workflows/docsDeploy.yml @@ -9,7 +9,7 @@ on: - 'docs/**' repository_dispatch: types: deploy-docs - + workflow_dispatch: jobs: build: runs-on: ubuntu-latest