Skip to content

Merge branch 'main' of https://github.com/AltCamp/altcampv1-backend #2

Merge branch 'main' of https://github.com/AltCamp/altcampv1-backend

Merge branch 'main' of https://github.com/AltCamp/altcampv1-backend #2

name: Deployment pipeline
on:
push:
branches: [main]
jobs:
pre_build_run:
runs-on: ubuntu-20.04
environment:
name: Pre-deployment
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Check code style
run: npm run format:check
- name: Lint code base
run: npm run lint
- name: Run tests
env:
TEST_CLOUDINARY_CLOUD_NAME: ${{ secrets.TEST_CLOUDINARY_CLOUD_NAME }}
TEST_CLOUDINARY_API_KEY: ${{ secrets.TEST_CLOUDINARY_API_KEY }}
TEST_CLOUDINARY_API_SECRET: ${{ secrets.TEST_CLOUDINARY_API_SECRET }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
JWT_EXPIRY: ${{ secrets.JWT_EXPIRY }}
run: npm run test
build:
needs: pre_build_run
runs-on: self-hosted
environment:
name: Pre-deployment
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Decrypt files for ${{ github.ref }}
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$PASSPHRASE" --output .env .locke.gpg
env:
PASSPHRASE: ${{ secrets.PASSPHRASE }}
- name: Install dependencies
run: npm install --omit=dev