Merge pull request #67 from maikusobu/social---maikusobu #29
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: Deployment pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [main] | |
types: [opened, synchronize] | |
jobs: | |
Test_and_lint_on_client: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: "npm" | |
cache-dependency-path: "client/package-lock.json" | |
- name: Install dependencies for client | |
run: | | |
cd client | |
npm ci --force | |
- name: Run lint for client | |
run: | | |
cd client | |
npm run lint | |
- name: Run tests for client | |
run: | | |
cd client | |
npm run test | |
Test_and_lint_on_server: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: "npm" | |
cache-dependency-path: "server/package-lock.json" | |
- name: Install dependencies for server | |
run: | | |
cd server | |
npm ci | |
- name: Run lint for server | |
run: | | |
cd server | |
npm run lint | |
deploy: | |
needs: [Test_and_lint_on_client, Test_and_lint_on_server] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Deploy to production | |
uses: johnbeynon/[email protected] | |
with: | |
service-id: ${{ secrets.RENDER_SERVICE_ID }} | |
api-key: ${{ secrets.RENDER_API }} | |
tag_release: | |
needs: [deploy] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Bump version and push tag | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |