chore: deploy actions (#5690)

Co-authored-by: Maksim Karatkevich <m.karatkevich@akveo.com>
This commit is contained in:
maksim-karatkevich 2020-05-19 17:03:48 +03:00 committed by GitHub
parent e02e2bd937
commit 2f9ce78488
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,13 @@
### Actions deploy guide
In order to trigger workflow 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": "<ACTION>"}' \`
`https://api.github.com/repos/akveo/ngx-admin/dispatches`
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')

29
.github/workflows/demoDeploy.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Deploy to demo
on:
push:
branches:
- 'demo'
paths:
- 'src/**'
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:demo:prod
- run: rsync -r --delete-after dist/. "${{ secrets.REMOTE_URL }}":"${{ secrets.ADDRESS }}"

29
.github/workflows/docsDeploy.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Deploy docs
on:
push:
branches:
- 'demo'
paths:
- 'docs/**'
repository_dispatch:
types: deploy-docs
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Use Node.js 12.x
uses: actions/setup-node@v1
- uses: actions/checkout@v2
with:
ref: demo
- name: Deploy
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
npm install --silent
git config --global user.email "github-action@akveo.com"
git config --global user.name "Github Action"
npm run docs:gh-pages