Skip to content

Commit

Permalink
ci: setup github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
matheushenriquefs committed Mar 1, 2024
1 parent 0f124da commit 306bbe2
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: ci
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- run: npm install
- name: Run code linting
run: npm run lintformat
unit-test:
runs-on: ubuntu-22.04
needs: [lint]
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- run: npm install
- name: Run unit tests
run: npm run test-unit
build:
runs-on: ubuntu-22.04
needs: [unit-test]
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- run: npm install
- name: Run build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "./dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default defineConfig({
optimizeDeps: {
exclude: ["vue-demi"],
},
base: "/pomodoro-timer",
server: {
host: true,
port: 3000,
Expand Down

0 comments on commit 306bbe2

Please sign in to comment.