Skip to content

Commit

Permalink
chore: split release and deploy workflows, use workflow_dispatch for …
Browse files Browse the repository at this point in the history
…manual run
  • Loading branch information
steve-lebleu committed Jan 25, 2025
1 parent a3780c4 commit 88aa48c
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build

on:
push:
branches: [ dev, master, hotfix/*, feature/*, release/* ]
branches: [ master, hotfix/*, feature/*, release/* ]

jobs:
build:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy

on:
workflow_dispatch:

jobs:
deploy-demo:
name: Deploy demo website
runs-on: ubuntu-latest
steps:
- name: Github checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node.js environment
uses: actions/setup-node@v4
with:
node-version: '20.18.0'
registry-url: 'https://registry.npmjs.org'
- name: Install Node.js dependencies
run: npm ci
- name: Build dist
run: npm run dist
- name: Build demo
run: npm run demo
- name: Deploy demo using SCP
uses: garygrossgarten/github-action-scp@release
with:
local: demo
remote: ${{ vars.KONFER_SSH_TARGET }}
host: ${{ secrets.KONFER_SSH_HOST }}
username: ${{ secrets.KONFER_SSH_USER }}
password: ${{ secrets.KONFER_SSH_PWD }}

deploy-documentation:
name: Deploy documentation
runs-on: ubuntu-latest
steps:
- name: Github checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Restore cache for node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js dependencies
run: npm ci
- name: Build documentation
run: npm run docs:build
- name: Deploy documentation using SCP
uses: garygrossgarten/github-action-scp@release
with:
local: docs/.vitepress/dist
remote: "${{ vars.KONFER_SSH_TARGET_DOC }}"
host: ${{ secrets.KONFER_SSH_HOST }}
username: ${{ secrets.KONFER_SSH_USER }}
password: ${{ secrets.KONFER_SSH_PWD }}
68 changes: 1 addition & 67 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,70 +168,4 @@ jobs:
- name: Create NPM release
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.KONFER_NPM_TOKEN }}

deploy-demo:
name: Deploy demo website
runs-on: ubuntu-latest
needs: [ release-github, release-npm ]
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-files
path: ./
- name: Setup node.js environment
uses: actions/setup-node@v4
with:
node-version: '20.18.0'
registry-url: 'https://registry.npmjs.org'
- name: Restore cache for node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js dependencies
run: npm ci
- name: Build dist
run: npm run dist
- name: Build demo
run: npm run demo
- name: Deploy demo using SCP
uses: garygrossgarten/github-action-scp@release
with:
local: demo
remote: ${{ vars.KONFER_SSH_TARGET }}
host: ${{ secrets.KONFER_SSH_HOST }}
username: ${{ secrets.KONFER_SSH_USER }}
password: ${{ secrets.KONFER_SSH_PWD }}

deploy-documentation:
name: Deploy documentation
runs-on: ubuntu-latest
needs: [ release-github, release-npm ]
steps:
- name: Github checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Restore cache for node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js dependencies
run: npm ci
- name: Build documentation
run: npm run docs:build
- name: Deploy documentation using SCP
uses: garygrossgarten/github-action-scp@release
with:
local: docs/.vitepress/dist
remote: "${{ vars.KONFER_SSH_TARGET_DOC }}"
host: ${{ secrets.KONFER_SSH_HOST }}
username: ${{ secrets.KONFER_SSH_USER }}
password: ${{ secrets.KONFER_SSH_PWD }}
NODE_AUTH_TOKEN: ${{ secrets.KONFER_NPM_TOKEN }}

0 comments on commit 88aa48c

Please sign in to comment.