From 88aa48cc1d96d0916db57573be79b2171b743115 Mon Sep 17 00:00:00 2001 From: Steve Lebleu Date: Sat, 25 Jan 2025 11:59:53 +0100 Subject: [PATCH] chore: split release and deploy workflows, use workflow_dispatch for manual run --- .github/workflows/build.yml | 2 +- .github/workflows/deploy.yml | 61 +++++++++++++++++++++++++++++++ .github/workflows/release.yml | 68 +---------------------------------- 3 files changed, 63 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4579531..ab2ebff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build on: push: - branches: [ dev, master, hotfix/*, feature/*, release/* ] + branches: [ master, hotfix/*, feature/*, release/* ] jobs: build: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..9aa540b --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eaaefb2..c985d33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.KONFER_NPM_TOKEN }} \ No newline at end of file