diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml deleted file mode 100644 index a567628e..00000000 --- a/.github/workflows/cd.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: CD - -on: - push: - branches: ["main"] - -jobs: - deploy: - name: Deploy - runs-on: ubuntu-latest - environment: - name: production - url: https://sos.sspwr.edu.eu.org - steps: - - name: Deploy - uses: appleboy/ssh-action@v0.1.7 - env: - CI: true - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - port: ${{ secrets.PORT }} - envs: CI - script: | - cd ${{ secrets.APP_DIR }} - rm .env - touch .env - echo NEXTAUTH_URL=https://sos.sspwr.edu.eu.org >> .env - echo NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }} >> .env - echo GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} >> .env - echo GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }} >> .env - echo DATABASE_URL="postgres://postgres:postgres@localhost:5432/postgres" >> .env - git pull - npm ci - npm run build - npx prisma migrate deploy - pm2 reload ecosystem.config.js - release: - name: Release - runs-on: ubuntu-latest - needs: deploy - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - persist-credentials: false - - uses: actions/setup-node@v3 - with: - node-version: 16 - - uses: bahmutov/npm-install@v1 - with: - useRollingCache: true - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - GIT_AUTHOR_NAME: ${{ vars.GIT_AUTHOR_NAME }} - GIT_AUTHOR_EMAIL: ${{ vars.GIT_AUTHOR_EMAIL }} - GIT_COMMITTER_NAME: ${{ vars.GIT_COMMITTER_NAME }} - GIT_COMMITTER_EMAIL: ${{ vars.GIT_COMMITTER_EMAIL }} - run: yarn semantic-release