Merge pull request #506 from workshopapps/Joe #186
This file contains hidden or 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-Pipeline | |
| # on: | |
| # workflow_dispatch: | |
| # push: | |
| # pull_request: | |
| # branches: ["dev", "main"] | |
| # # testing | |
| # env: | |
| # PORT: ${{ secrets.PORT }} | |
| # MYSQL_HOST: ${{ secrets.MYSQL_HOST }} | |
| # DB_PORT: ${{ secrets.DB_PORT }} | |
| # DB_USER: ${{ secrets.DB_USER }} | |
| # DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| # DB_DATABASE: ${{ secrets.DB_DATABASE }} | |
| # TEST_DB_DATABASE: ${{ secrets.TEST_DB_DATABASE }} | |
| # TEST_DB_USER: ${{ secrets.TEST_DB_USER }} | |
| # TEST_DB_PASSWORD: ${{ secrets.TEST_DB_PASSWORD }} | |
| # MYSQL_DATABASE: ${{ secrets.MYSQL_DATABASE }} | |
| # MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }} | |
| # MYSQL_USER: ${{ secrets.MYSQL_USER }} | |
| # MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }} | |
| # CI: ${{ secrets.CI }} | |
| # jobs: | |
| # # Testing | |
| # build_and_test_frontend: | |
| # runs-on: ubuntu-latest | |
| # strategy: | |
| # matrix: | |
| # node-version: [14.x] | |
| # steps: | |
| # - name: Checkout Repo | |
| # uses: actions/checkout@v3 | |
| # - name: setup node | |
| # uses: actions/setup-node@v3 | |
| # with: | |
| # node-version: 14 | |
| # - name: install dependencies | |
| # working-directory: frontend_website/ | |
| # run: | | |
| # npm install --force | |
| # npm ci | |
| # - name: build and test | |
| # #env: | |
| # #CI: "" | |
| # working-directory: frontend_website/ | |
| # run: | | |
| # npm run build --if-present | |
| # npm test | |
| # build_and_test_backend: | |
| # runs-on: ubuntu-latest | |
| # strategy: | |
| # matrix: | |
| # node-version: [14.x] | |
| # steps: | |
| # - name: Checkout Repo | |
| # uses: actions/checkout@v3 | |
| # - name: setup node | |
| # uses: actions/setup-node@v3 | |
| # with: | |
| # node-version: 14 | |
| # - name: install dependencies | |
| # working-directory: backend/ | |
| # run: | | |
| # npm install | |
| # npm ci | |
| # - name: build and test | |
| # working-directory: backend/ | |
| # run: | | |
| # npm run build --if-present | |
| # # npm test | |
| # dockerize_stack_and_test_dockerized_stack: | |
| # runs-on: ubuntu-latest | |
| # needs: [build_and_test_frontend, build_and_test_backend] | |
| # steps: | |
| # - uses: actions/checkout@v2 | |
| # - name: Docker Login | |
| # uses: docker/login-action@v2.1.0 | |
| # with: | |
| # username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| # password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # - name: Build the frontend and backend stack | |
| # run: docker-compose up --remove-orphans -d | |
| # - name: Push stack images to DockerHub | |
| # run: docker-compose push | |
| # deploy_stack: | |
| # runs-on: ubuntu-latest | |
| # needs: [dockerize_stack_and_test_dockerized_stack] | |
| # steps: | |
| # - uses: actions/checkout@v3 | |
| # - name: Push to server and deploy | |
| # uses: fifsky/ssh-action@master | |
| # with: | |
| # host: ${{ secrets.DEV_HOST }} | |
| # user: ${{ secrets.DEV_USERNAME }} | |
| # port: ${{ secrets.ACCESS_PORT }} | |
| # key: ${{ secrets.DEV_SSHKEY }} | |
| # command: cd ${{ secrets.DEV_PATH }} && sudo docker-compose pull && sudo docker-compose up -d |