ci: fix main workflow

issue #25
This commit is contained in:
Ricardo Campos
2024-08-25 14:00:05 -03:00
parent c8b47db3d2
commit 33c8883607
5 changed files with 56 additions and 52 deletions
+6 -2
View File
@@ -1,9 +1,13 @@
# Description
Closes #issue
### Additional Notes
## Time Spent
### Tests
X hours and X minutes
## Additional Notes
## Tests
- [ ] 🧠 Not needed
- [ ] 👀 Eyeball
- [ ] 🤖 Added tests
+16 -37
View File
@@ -7,46 +7,25 @@ on:
workflow_dispatch:
jobs:
release:
name: Auto release
code-checks:
name: Code Checks
runs-on: ubuntu-latest
outputs:
version: ${{ steps.changelog.outputs.version }}
steps:
- uses: actions/checkout@v4
#with:
# token: ${{ secrets.PAT }}
# fetch-depth: 0
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Conventional Changelog Update
uses: TriPSs/conventional-changelog-action@v5
id: changelog
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
output-file: 'CHANGELOG.md'
skip-version-file: 'true'
skip-commit: 'true'
git-push: 'false'
skip-on-empty: 'false'
- name: Set new version
run: |
echo "::set-output name=version::${{ steps.changelog.outputs.version }}"
npm version minor
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Ci Bot
author_email: cibot@users.noreply.github.com
message: 'doc: updating package to ${{ steps.changelog.outputs.version }} [ci skip]'
add: '["packages.json","CHANGELOG.md"]'
- name: Create Release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ steps.changelog.outputs.tag }}
name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
- name: Clean and Install
run: npm ci
- name: Build
run: npm run build
- name: Lint
run: npm run lint
#- name: Unit tests
# run: npm run test
+27 -10
View File
@@ -12,21 +12,38 @@ jobs:
name: Code Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Node
uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
name: Set up Node
with:
node-version: '20'
- name: Clean and Install
run: npm ci
- name: Build
run: npm run build
#- name: Lint
# run: npm run lint
- name: Lint
run: npm run lint
#- name: Unit tests
# run: npm run test
docker-build:
name: Build Docker image
runs-on: ubuntu-latest
needs:
- code-checks
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
name: Set up Docker Buildx
- uses: docker/login-action@v3
name: Login to Docker Hub
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: rmcampos/tasknote:${{ github.event.number }}
cache-from: type=gha
cache-to: type=gha,mode=max
+2 -3
View File
@@ -1,8 +1,7 @@
# TaskNote
[![License](https://img.shields.io/github/license/username/repo.svg)](LICENSE)
<!--[![Build Status](https://img.shields.io/github/actions/workflow/status/username/repo/build.yml)](https://github.com/username/repo/actions)-->
[![Build Status](https://github.com/ricardo-campos-org/react-typescript-todolist/actions/workflows/main.yml/badge.svg)]
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
![Build Status](https://github.com/ricardo-campos-org/react-typescript-todolist/actions/workflows/main.yml/badge.svg)
## 📋 Table of Contents
+5
View File
@@ -0,0 +1,5 @@
# Tools
- **TaskNote:** https://tasknote.local
- **Docker Hub:** https://hub.docker.com/
- **Time tracking:** https://track.toggl.com/timer