Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version #1

Merged
merged 9 commits into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 74 additions & 4 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@ name: Deployment Pipeline

on:
push:
branches:
- main
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize]

jobs:
deploy:

avoid_reduncy:
runs-on: ubuntu-18.04
steps:
- name: Cancel Previous Redundant Builds
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

lint:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
Expand All @@ -19,21 +30,80 @@ jobs:
run: npm ci
- name: Lint
run: npm run eslint

build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist

test:
needs: [lint, build]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: npm ci
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Test
run: npm test

e2e:
needs: [lint, build]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: npm ci
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: E2E tests
uses: cypress-io/github-action@v2
with:
command: npm run test:e2e
start: npm run start-test
wait-on: https://localhost:5000

deploy:
needs: [test, e2e]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Deploy to Heroku
if: ${{ github.event_name == 'push' }}
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{secrets.HEROKU_APP}}
heroku_email: ${{secrets.HEROKU_API_EMAIL}}
healthcheck: "https://${{secrets.HEROKU_APP}}/health"
healthcheck: "https://${{secrets.HEROKU_APP}}.herokuapp.com/health"
rollbackonhealthcheckfailed: true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fullstackopen-cicd",
"version": "1.0.0",
"version": "1.0.4",
"description": "Full Stack Open",
"main": "src/index.js",
"scripts": {
Expand Down