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
39 changes: 32 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ name: CI

on:
pull_request:
branches: [develop]
branches: [develop, master]
push:
branches: [develop]
branches: [develop, 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
Expand All @@ -21,7 +24,7 @@ jobs:
- name: Use NodeJS
uses: actions/setup-node@v1
with:
node-version: "12.x"
node-version: "16.x"
- run: npm ci
- run: npm run format:check
- run: npm test -- --coverage
Expand All @@ -41,9 +44,31 @@ jobs:
with:
name: build
path: build
- 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.GITHUB_TOKEN }}
- name: Deploy to Staging
if: github.event_name == 'push'
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
run: npx surge --project ./build --domain br648.surge.sh
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN}}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN}}
- name: Deploy to Prod
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: npx surge --project ./build --domain whispering-fact.surge.sh
- 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.GITHUB_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 }}"]
}'
6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/sonarlint/issuestore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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