Merge pull request #98 from melfore/develop #35
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: Konva Timeline - Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/hydrogen | |
- name: Cache Dependencies | |
id: cache-dependencies | |
uses: actions/cache@v3 | |
env: | |
cache-name: konva-timeline-dependencies | |
with: | |
path: node_modules | |
key: konva-timeline-dependencies-${{ hashFiles('**/package-lock.json') }} | |
- name: Install Dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Git Config | |
run: | | |
git config --local user.email "${{ secrets.GIT_USER_EMAIL }}" | |
git config --local user.name "${{ secrets.GIT_USER_NAME }}" | |
git pull | |
- name: Run ESLint and Prettier | |
id: code-format | |
run: | | |
npm run clean:code | |
git add . | |
echo "::set-output name=formatted-files::$(git status -s -uno | wc -l)" | |
- name: Commit Changes | |
if: steps.code-format.outputs.formatted-files > 0 | |
run: | | |
git commit -m "refactor: 💡 Clean code" -a | |
- name: Generate Docs | |
id: generate-docs | |
run: | | |
npm run build:storybook | |
git add . | |
echo "::set-output name=generated-docs::$(git status -s -uno | wc -l)" | |
- name: Commit Changes | |
if: steps.generate-docs.outputs.generated-docs > 0 | |
run: | | |
git commit -m "docs: ✏️ Updated StoryBook" -a | |
- name: Test runner | |
run: | | |
npx playwright install --with-deps | |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ | |
"npx http-server docs --port 6006 --silent" \ | |
"npx wait-on tcp:127.0.0.1:6006 && npm run test:sb" | |
- name: Build | |
run: npm run build | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.PA_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx semantic-release | |
- name: Send Notification | |
uses: Co-qn/google-chat-notification@master | |
with: | |
name: Konva Timeline - Release | |
url: ${{ secrets.GOOGLE_CHAT }} | |
status: ${{ job.status }} | |
if: always() |