Skip to content

Commit

Permalink
chore: deploy demo action
Browse files Browse the repository at this point in the history
* create deploy demo script
* action trigger guide added
  • Loading branch information
maksim-karatkevich authored May 14, 2020
1 parent 9eaf0bb commit 7b84933
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ACTION_TRIGGER_GUIDE.md
Original file line number Diff line number Diff line change
@@ -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 <ACCESS_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
<br>`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)
24 changes: 24 additions & 0 deletions .github/workflows/demoDeploy.yml
Original file line number Diff line number Diff line change
@@ -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 }}"

0 comments on commit 7b84933

Please sign in to comment.