60 lines
1.2 KiB
YAML
60 lines
1.2 KiB
YAML
name: Test CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: runner
|
|
|
|
env:
|
|
DOCKER_VOLUME: ${{ vars.DOCKER_VOLUME }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Check PWD
|
|
run: |
|
|
echo $DOCKER_VOLUME
|
|
echo $PWD
|
|
ls .
|
|
|
|
- name: Restore node_modules
|
|
id: cache-node
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: node_modules
|
|
key: minio-yarn-cache-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
yarn-cache-
|
|
|
|
- name: Restore dist
|
|
id: cache-dist
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: dist
|
|
key: minio-dist-cache-${{ github.ref_name }}-${{ hashFiles('**/*.ts') }}
|
|
|
|
- name: Install Dependencies with yarn
|
|
if: steps.cache-node.outputs.cache-hit != 'true'
|
|
run: |
|
|
yarn install --immutable
|
|
ls .
|
|
|
|
- name: Build Nestjs project
|
|
if: steps.cache-dist.outputs.cache-hit != 'true'
|
|
run: |
|
|
yarn build
|
|
ls .
|
|
|
|
- name: Deploy dist
|
|
run: |
|
|
cp -r dist $DOCKER_VOLUME/scheduler/back/
|
|
ls $DOCKER_VOLUME/scheduler/back
|
|
|
|
- name: Clean project
|
|
run: |
|
|
rm -rf node_modules
|
|
rm -rf dist |