diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..796673b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: Continuous Integration + +on: + pull_request: + branches: + - main + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run linter + run: npm run lint + + - name: Run tests + run: npm test + + - name: Build project + run: npm run build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f49be1a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,56 @@ +name: Build and Deploy to GitHub Pages + +on: + push: + branches: + - main + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Build project + run: npm run build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml new file mode 100644 index 0000000..2373323 --- /dev/null +++ b/.github/workflows/version-bump.yml @@ -0,0 +1,64 @@ +name: Version Bump + +on: + workflow_run: + workflows: ["Build and Deploy to GitHub Pages"] + types: + - completed + +permissions: + contents: write + pull-requests: write + +jobs: + version-bump: + runs-on: ubuntu-latest + # Only run if the previous workflow succeeded + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Create version bump branch + run: | + BRANCH_NAME="version-bump-$(date +%Y%m%d-%H%M%S)" + git checkout -b $BRANCH_NAME + echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + + - name: Bump version + run: npm version minor --no-git-tag-version + + - name: Commit version bump + run: | + git add package.json package-lock.json + NEW_VERSION=$(node -p "require('./package.json').version") + git commit -m "chore: bump version to $NEW_VERSION" + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + + - name: Push changes + run: git push origin $BRANCH_NAME + + - name: Create Pull Request + env: + GH_TOKEN: ${{ github.token }} + run: | + gh pr create \ + --title "chore: bump version to $NEW_VERSION" \ + --body "Automated version bump to \`$NEW_VERSION\` after successful deployment. + + This PR was automatically created by the version-bump workflow." \ + --base main \ + --head $BRANCH_NAME diff --git a/README.md b/README.md index 08a5c5e..b5c805a 100644 --- a/README.md +++ b/README.md @@ -72,5 +72,15 @@ npm run lint:fix npm run format ``` +## CI/CD + +This project uses GitHub Actions for continuous integration and deployment: + +### Automated Workflows + +- **CI**: Runs linter, tests, and build on all non-main branches and pull requests +- **Build and Deploy**: Automatically builds and deploys to GitHub Pages on every tag +- **Version Bump**: Creates a PR with a minor version bump after successful deployment + ## AI Disclaimer AI tools have been used to contribute to this project. diff --git a/mise.toml b/mise.toml index 671b34e..5668001 100644 --- a/mise.toml +++ b/mise.toml @@ -1,3 +1,2 @@ [tools] node = "24.9.0" -docker-cli = "28.5.0" diff --git a/package.json b/package.json index 28d40f3..19b822f 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test:watch": "vitest watch", "test:ui": "vitest --ui", "test:coverage": "vitest --coverage", - "lint": "eslint .", + "lint": "eslint . --max-warnings=0", "lint:fix": "eslint . --fix", "format": "prettier --write \"src/**/*.{js,css,html}\"" }, diff --git a/src/components/layout/ActionBar.vue b/src/components/layout/ActionBar.vue index b50bac9..943df4a 100644 --- a/src/components/layout/ActionBar.vue +++ b/src/components/layout/ActionBar.vue @@ -46,7 +46,7 @@