fix client CI try #2 #391
Workflow file for this run
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: Client CI/CD | ||
on: [push, workflow_dispatch] | ||
env: | ||
NEXT_PUBLIC_BASE_PATH: "" | ||
jobs: | ||
tests: | ||
name: Run client tests | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout️ | ||
uses: actions/checkout@v4 | ||
- name: Node setup | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: 'client/.nvmrc' | ||
- uses: pnpm/action-setup@v4 | ||
- name: Cache dependencies | ||
working-directory: client | ||
uses: actions/cache@v3 | ||
Check failure on line 26 in .github/workflows/client_ci_cd.yml GitHub Actions / Client CI/CDInvalid workflow file
|
||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node_modules-${{ hashFiles('pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-node_modules- | ||
- name: Run tests | ||
working-directory: client | ||
run: pnpm test | ||
deploy: | ||
name: Deploy client app | ||
# if: (github.head_ref || github.ref_name) == 'main' || (github.head_ref || github.ref_name) == 'staging' | ||
if: (github.head_ref || github.ref_name) == 'staging' | ||
runs-on: ubuntu-20.04 | ||
needs: tests | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Install ruby + gems | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1.2 | ||
bundler-cache: true | ||
working-directory: client | ||
- name: Extract branch name | ||
shell: bash | ||
run: | | ||
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
echo "##[set-output name=branch-upper;]$(echo ${GITHUB_REF#refs/heads/} | tr a-z A-Z )" | ||
id: extract_branch | ||
- name: Deploy using capistrano | ||
uses: miloserdow/capistrano-deploy@master | ||
with: | ||
working-directory: client | ||
target: ${{ steps.extract_branch.outputs.branch == 'main' && 'production' || steps.extract_branch.outputs.branch }} | ||
deploy_key: ${{ secrets.DEPLOY_KEY_PASSWORD }} | ||
enc_rsa_key_val: ${{ secrets.DEPLOY_ENC_KEY }} |