From 71bf10eccd7d6798a10e11c723f3eabf5de1668f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sr=C4=91an=20Vidovi=C4=87?= Date: Wed, 10 Jun 2026 15:02:45 +0200 Subject: [PATCH 1/5] Parallel lint/scan/test; build gated; release asset --- .github/workflows/ci-cd.yml | 87 +++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/ci-cd.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..4372fc8 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,87 @@ +name: CI/CD Pipeline + +on: + pull_request: + branches: [ main ] + types: [ opened, synchronize ] + +permissions: + contents: write + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install dependencies + run: npm install + - name: Run linter + run: npm run lint + # If you haven't set up ESLint yet, see https://eslint.org/docs/latest/user-guide/getting-started + + security-scan: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install dependencies + run: npm install + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: javascript + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install dependencies + run: npm install + - name: Run tests + run: npm test + +build: + needs: [lint, security-scan, test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: { node-version: 16 } + - run: npm install + - run: npm run build + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + +release: + needs: build + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # provided automatically by GitHub + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v4 + with: { name: dist } + - id: create_release + uses: elgohr/Github-Release-Action@v5 + with: + title: Dev Build ${{ github.sha }} + tag: dev-${{ github.sha }} + prerelease: true From a858610d2bc9c630b8d30c9a8dd683aaed29f6ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sr=C4=91an=20Vidovi=C4=87?= Date: Wed, 10 Jun 2026 15:12:48 +0200 Subject: [PATCH 2/5] a --- .github/workflows/ci.yml | 35 ++++++++++++++++------------ .github/workflows/ci.yml.s.txt | 20 ++++++++++++++++ .github/workflows/upstream.yml | 42 ++++++++++++++++++++++++++++++++++ README.md | 4 +++- 4 files changed, 85 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/ci.yml.s.txt create mode 100644 .github/workflows/upstream.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3a0992..6dbafaf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,20 +1,25 @@ -name: Secure CI/CD Pipeline - +name: GitHub Actions Build and Deploy Demo on: push: - branches: [main] - pull_request: - branches: [main] - + branches: + - master jobs: - security-scan: + build-and-deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Run security audit - run: npm audit --audit-level=high - - - name: SAST with CodeQL - uses: github/codeql-action/analyze@v3 - with: - languages: javascript + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Checkout + uses: actions/checkout@v4 + - name: Install and Build + run: | + npm install + npm run-script build + - name: Deploy + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages + FOLDER: build diff --git a/.github/workflows/ci.yml.s.txt b/.github/workflows/ci.yml.s.txt new file mode 100644 index 0000000..e3a0992 --- /dev/null +++ b/.github/workflows/ci.yml.s.txt @@ -0,0 +1,20 @@ +name: Secure CI/CD Pipeline + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + security-scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run security audit + run: npm audit --audit-level=high + + - name: SAST with CodeQL + uses: github/codeql-action/analyze@v3 + with: + languages: javascript diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml new file mode 100644 index 0000000..5684c2b --- /dev/null +++ b/.github/workflows/upstream.yml @@ -0,0 +1,42 @@ +name: upstream + +on: + workflow_dispatch: + schedule: + - cron: "33 3 * * 3" # weekly + +permissions: + contents: read + issues: write # to create issues if the upstream check fails + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: ['latest'] + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run upstream + - name: Handle error + if: ${{ failure() }} + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const { owner, repo } = context.repo; + const nodeVersion = process.version; + const issueTitle = `Upstream check failed`; + const issueBody = `Node ${nodeVersion} has made changes to the functions this module depends on. Please review the new function changes, determine if this module requires changes because of them, and update the function hashes. Add a comment below with your findings.`; + + const issue = await github.rest.issues.create({ + owner, + repo, + title: issueTitle, + body: issueBody, + }); diff --git a/README.md b/README.md index 320564c..37fd582 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![CI Pipeline Badge](https://github.com/your-user/your-repo/actions/workflows/ci-cd.yml/badge.svg) + # Tailwind CSS for Rails [Tailwind CSS](https://tailwindcss.com) is a utility-first CSS framework packed with classes like `flex`, `pt-4`, `text-center` and `rotate-90` that can be composed to build any design, directly in your markup. @@ -104,7 +106,7 @@ gem "tailwindcss-ruby", "~> 3.4" # only necessary with tailwindcss-rails <= 3.3. First, update to `tailwindcss-rails` v4.0.0 or higher. This will also ensure you're transitively depending on `tailwindcss-ruby` v4. ```ruby -# Gemfile +# Gemfile gem "tailwindcss-rails", "~> 4.0" # which transitively pins tailwindcss-ruby to v4 ``` From 954c028a28b22b5b17fa0fb606cbc988d6db5624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sr=C4=91an=20Vidovi=C4=87?= Date: Wed, 10 Jun 2026 15:17:53 +0200 Subject: [PATCH 3/5] 1 --- .github/workflows/{ci-cd.yml => ci-cd.yml.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ci-cd.yml => ci-cd.yml.txt} (100%) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml.txt similarity index 100% rename from .github/workflows/ci-cd.yml rename to .github/workflows/ci-cd.yml.txt From 4de4ea764313f0d9efd1ca063c7f0b6031904d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sr=C4=91an=20Vidovi=C4=87?= Date: Wed, 10 Jun 2026 15:22:46 +0200 Subject: [PATCH 4/5] q --- .github/workflows/ci.yml | 35 +++++++++++++++------------------- .github/workflows/ci.yml.s.txt | 20 ------------------- .github/workflows/ci1.yml.txt | 25 ++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/ci.yml.s.txt create mode 100644 .github/workflows/ci1.yml.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dbafaf..e3a0992 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,25 +1,20 @@ -name: GitHub Actions Build and Deploy Demo +name: Secure CI/CD Pipeline + on: push: - branches: - - master + branches: [main] + pull_request: + branches: [main] + jobs: - build-and-deploy: + security-scan: runs-on: ubuntu-latest steps: - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: Checkout - uses: actions/checkout@v4 - - name: Install and Build - run: | - npm install - npm run-script build - - name: Deploy - uses: JamesIves/github-pages-deploy-action@releases/v3 - with: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} - BRANCH: gh-pages - FOLDER: build + - uses: actions/checkout@v4 + - name: Run security audit + run: npm audit --audit-level=high + + - name: SAST with CodeQL + uses: github/codeql-action/analyze@v3 + with: + languages: javascript diff --git a/.github/workflows/ci.yml.s.txt b/.github/workflows/ci.yml.s.txt deleted file mode 100644 index e3a0992..0000000 --- a/.github/workflows/ci.yml.s.txt +++ /dev/null @@ -1,20 +0,0 @@ -name: Secure CI/CD Pipeline - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - security-scan: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Run security audit - run: npm audit --audit-level=high - - - name: SAST with CodeQL - uses: github/codeql-action/analyze@v3 - with: - languages: javascript diff --git a/.github/workflows/ci1.yml.txt b/.github/workflows/ci1.yml.txt new file mode 100644 index 0000000..6dbafaf --- /dev/null +++ b/.github/workflows/ci1.yml.txt @@ -0,0 +1,25 @@ +name: GitHub Actions Build and Deploy Demo +on: + push: + branches: + - master +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Checkout + uses: actions/checkout@v4 + - name: Install and Build + run: | + npm install + npm run-script build + - name: Deploy + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages + FOLDER: build From 8150ea3923af3974a426760bca801c67e94bd84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sr=C4=91an=20Vidovi=C4=87?= Date: Wed, 10 Jun 2026 15:26:25 +0200 Subject: [PATCH 5/5] q --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37fd582..12577a8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![CI Pipeline Badge](https://github.com/your-user/your-repo/actions/workflows/ci-cd.yml/badge.svg) +>![CI Pipeline Badge](https://github.com/your-user/your-repo/actions/workflows/ci-cd.yml/badge.svg) # Tailwind CSS for Rails