feat: add validation .tool-versions file #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
type: choice | |
description: Target branch name | |
required: false | |
default: main | |
options: | |
## v1 is a fixed major version | |
- v1 | |
## main will always be latest (regardless of major version) | |
- main | |
## dev is for testing only | |
- dev | |
force: | |
type: boolean | |
description: Force the deployment | |
required: false | |
default: false | |
push: | |
branches: | |
- main | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
env: | |
AC_FORCE: ${{ inputs.force }} | |
AC_AUTOBUILD: false | |
AC_OUTPUT: common/temp/actions | |
AC_COMMIT_REPO: kc-workspace/github-actions | |
AC_COMMIT_BRANCH: ${{ inputs.branch || 'main' }} | |
steps: | |
- name: Set up base repository | |
uses: actions/checkout@v4 | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Set up nodejs | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
cache-dependency-path: pnpm-lock.yaml | |
cache: pnpm | |
- name: Install dependencies | |
run: common/scripts/index.sh install | |
- name: Lint / Build / Test packages | |
run: common/scripts/index.sh test | |
- name: Set up target repository | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ env.AC_COMMIT_REPO }} | |
ref: ${{ env.AC_COMMIT_BRANCH }} | |
path: ${{ env.AC_OUTPUT }} | |
ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
fetch-depth: 0 | |
- name: Deploy target repository | |
run: common/scripts/index.sh deploy |