Merge pull request #125 from NoWaste-SE/fix/fix-request-problems #147
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: CI/CD | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
CI_version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js 19.x # 19.7.0 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 19.x # 19.7.0 | |
cache: 'npm' | |
- name: Install npm | |
run: npm install --force | |
- name: Build project | |
run: CI=false npm run build --if-present | |
# CI=false (treating warnings as errors because process.env.ci = true.) | |
- name: Run tests | |
run: npm run test | |
CD_version: | |
runs-on: ubuntu-latest | |
needs: CI_version | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 19.x # 19.7.0 | |
cache: 'npm' | |
- name: Remove unneccessary config files | |
run: find . -type f \( -name "docker-compose.yml" -o -name "Dockerfile" \) -exec rm -f {} + | |
- name: Update server and deliver last version | |
env: | |
LIARA_TOKEN: ${{ secrets.LIARA_API_TOKEN }} | |
run: | | |
npm i -g @liara/cli@5 --force | |
liara env:set CI=false --api-token="$LIARA_TOKEN" --app="nowaste" --force | |
liara deploy --app="nowaste" --api-token="$LIARA_TOKEN" --no-app-logs | |