2021-06-02 22:45:31 +02:00
|
|
|
name: Deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
release_version:
|
|
|
|
description: "Release Tag Version <vX.X.X>"
|
|
|
|
required: true
|
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
name: Deploy Web Vault
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repo
|
|
|
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
|
|
|
with:
|
2021-06-11 21:52:59 +02:00
|
|
|
ref: gh-pages
|
2021-06-02 22:45:31 +02:00
|
|
|
|
|
|
|
- name: Get release version
|
|
|
|
id: release-version
|
|
|
|
run: |
|
|
|
|
if [[ "${{ github.event_name }}" == "release" ]]; then
|
|
|
|
echo "::set-output name=version::${{ github.event.release.tag_name }}"
|
|
|
|
else
|
|
|
|
echo "::set-output name=version::${{ github.event.inputs.release_version }}"
|
|
|
|
fi
|
|
|
|
|
2021-06-11 21:52:59 +02:00
|
|
|
- name: Create deploy branch
|
|
|
|
run: |
|
|
|
|
git switch -c deploy-${{ steps.release-version.outputs.version }}
|
|
|
|
git push -u origin deploy-${{ steps.release-version.outputs.version }}
|
|
|
|
|
|
|
|
- name: Checkout Repo
|
|
|
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
|
|
|
with:
|
|
|
|
ref: rc
|
|
|
|
|
|
|
|
- name: setup git config
|
|
|
|
run: |
|
|
|
|
git config user.name = "GitHub Action Bot"
|
|
|
|
git config user.email = "<>"
|
2021-08-10 16:52:53 +02:00
|
|
|
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
|
|
|
|
git config --global url."https://".insteadOf ssh://
|
2021-06-11 21:52:59 +02:00
|
|
|
|
|
|
|
- name: Install and Build
|
|
|
|
run: |
|
2021-08-10 16:52:53 +02:00
|
|
|
npm run sub:init
|
2021-06-30 05:51:53 +02:00
|
|
|
npm ci
|
2021-06-11 21:52:59 +02:00
|
|
|
npm run dist
|
|
|
|
|
2021-06-02 22:45:31 +02:00
|
|
|
- name: Deploy GitHub Pages
|
|
|
|
uses: crazy-max/ghaction-github-pages@db4476a01402e1a7ce05f41832040eef16d14925 # v2.5.0
|
|
|
|
with:
|
2021-06-11 21:52:59 +02:00
|
|
|
target_branch: deploy-${{ steps.release-version.outputs.version }}
|
2021-06-02 22:45:31 +02:00
|
|
|
build_dir: build
|
|
|
|
keep_history: true
|
2021-06-11 21:52:59 +02:00
|
|
|
commit_message: "Staging deploy ${{ steps.release-version.outputs.version }}"
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Create Deploy PR
|
|
|
|
run: |
|
|
|
|
gh pr create --title "Deploy $VERSION" --body "Deploying $VERSION" --base gh-pages --head "$PR_BRANCH"
|
2021-06-02 22:45:31 +02:00
|
|
|
env:
|
2021-06-11 21:52:59 +02:00
|
|
|
VERSION: ${{ steps.release-version.outputs.version }}
|
|
|
|
PR_BRANCH: deploy-${{ steps.release-version.outputs.version }}
|
2021-06-02 22:45:31 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-06-11 21:52:59 +02:00
|
|
|
|