From 7b84933f7cd039d6be95bf555ba15e167e54e869 Mon Sep 17 00:00:00 2001 From: maksim-karatkevich Date: Thu, 14 May 2020 15:28:52 +0300 Subject: [PATCH] chore: deploy demo action * create deploy demo script * action trigger guide added --- .github/workflows/ACTION_TRIGGER_GUIDE.md | 12 ++++++++++++ .github/workflows/demoDeploy.yml | 24 +++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/ACTION_TRIGGER_GUIDE.md create mode 100644 .github/workflows/demoDeploy.yml diff --git a/.github/workflows/ACTION_TRIGGER_GUIDE.md b/.github/workflows/ACTION_TRIGGER_GUIDE.md new file mode 100644 index 0000000000..a9820da543 --- /dev/null +++ b/.github/workflows/ACTION_TRIGGER_GUIDE.md @@ -0,0 +1,12 @@ +### Actions deploy guide + +In order to trigger `deploy-to-demo` action you should execute the following curl: + +`curl -H "Accept: application/vnd.github.everest-preview+json" \ +-H "Authorization: token " \ +--request POST \ +--data '{"event_type": "deploy-to-demo"}' \ +https://api.github.com/repos/akveo/ngx-admin/dispatches` + +This curl expects `ACCESS_TOKEN` input parameter +
`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) diff --git a/.github/workflows/demoDeploy.yml b/.github/workflows/demoDeploy.yml new file mode 100644 index 0000000000..f783d5b402 --- /dev/null +++ b/.github/workflows/demoDeploy.yml @@ -0,0 +1,24 @@ + +name: Deploy to demo + +on: + repository_dispatch: + types: deploy-to-demo + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + known_hosts: ${{ secrets.KNOWN_HOSTS }} + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + - uses: actions/checkout@v2 + with: + ref: demo + - run: npm install + - run: npm run build:prod + - run: rsync -r --delete-after dist/. "${{ secrets.REMOTE_URL }}":"${{ secrets.ADDRESS }}"