Skip to content
Open
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
62 changes: 56 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,80 @@
name: CI
on:
pull_request:
branches: [dev]
branches: [dev, master]
push:
branches: [dev]
branches: [dev, master]

jobs:
build:
runs-on: ubuntu-latest
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Cache node_modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use NodeJS
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '14.x'
- run: npm ci
- run: npm run format:check
- run: npm test -- --coverage
env:
CI: true
- name: Upload Test Coverage
uses: actions/upload-artifact@v1
with:
name: code-coverage
path: coverage
- name: Build Project
if: github.event_name == 'push'
run: npm run build
- name: Deploy to Staging
- name: Upload Build Folder
if: github.event_name == 'push'
uses: actions/upload-artifact@v1
with:
name: build
path: build
# - uses: actions/download-artifacts
- name: Zip Assets
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
zip -r build.zip ./build
zip -r coverage.zip ./coverage
- name: Create a Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_TOKEN }}
- name: Deploy to Staging
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
run: npx surge --project ./build --domain obese-son-2021-12-09.surge.sh
- name: Deploy to Production
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: npx surge --project ./build --domain hysterical-band-prod.surge.sh
- name: Upload Coverage Reports
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: npx codecov
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Open Issue
if: failure() && github.event_name == 'pull_request'
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/issues \
--header 'authorization: Bearer ${{ secrets.CUSTOM_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"title": "Automated issue for commit: ${{ github.sha }}",
"body": "This issue was automatically created by the GitHub Action workflow **${{ github.workflow }}**. \n\n The commit hash was: _${{ github.sha }}_.",
"assignees": ["${{ github.event.pull_request.user.login }}"]
}' \
--fail
12 changes: 12 additions & 0 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Notify on issue
on:
issues:
types: [opened]

jobs:
slack-message:
runs-on: ubuntu-latest
steps:
- name: Slack Message for issue
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"New issue created <${{ github.event.issue.html_url }}|${{ github.event.issue.title}}>"}' ${{ secrets.SLACK_WEBHOOK }}
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Notify on Release
on:
release:
types: [published]

jobs:
slack-message:
runs-on: ubuntu-latest
steps:
- name: Slack Message
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"New release ${{ github.event.release.tag_name }} is out, <${{ github.event.release.html_url }}|check it out now.>"}' ${{ secrets.SLACK_WEBHOOK }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo

## Available Scripts

In the project directory, you can run:
In the project directory, you can run :

### `npm start`

Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
Loading