From 5728dceced5a596d3cf1ba3e71d15b8f2cedf478 Mon Sep 17 00:00:00 2001 From: Teguh Bayu Pratama <149038828+teguhbayu@users.noreply.github.com> Date: Sun, 19 May 2024 22:44:05 +0700 Subject: [PATCH] Create CD.yml --- .github/workflows/CD.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/CD.yml diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 0000000..9ee76d4 --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,35 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: deploy + +on: + push: + branches: [ "master" ] + +jobs: + build: + + runs-on: self-hosted + + strategy: + matrix: + node-version: [20.13.1] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + env: + DATABASE_URL: ${{secrets.DATABASE_URL}} + NEXTAUTH_SECRET: ${{secrets.NEXTAUTH_SECRET}} + CLOUDINARY_URL: ${{secrets.CLOUDINARY_URL}} + NEXTAUTH_URL: ${{secrets.NEXTAUTH_URL}} + GOOGLE_APP_PASSWORD: ${{secrets.GOOGLE_APP_PASSWORD}} + GOOGLE_EMAIL: ${{secrets.GOOGLE_EMAIL}} + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npx run prisma generate + - run: npm run build --if-present