Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move demo app publish to gh action #127

Merged
merged 6 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Unit Tests"
name: "CI"

on:
push:
Expand All @@ -12,7 +12,7 @@ on:

jobs:
build:
name: "Unit Tests on Ubuntu"
name: "Formatter and Unit Tests on Ubuntu"
runs-on: ubuntu-latest

steps:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/publish-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish to gh pages
on:
workflow_dispatch:
workflow_call:

env:
NPM_REGISTRY: https://registry.npmjs.org/

jobs:
publish-gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Configure Github Credentials
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

- name: Pull latest
run: |
git checkout main
git pull

- run: npm ci

- name: Get version
run: echo "latest_version=$(npm pkg get version --workspaces=false | tr -d \")" >> $GITHUB_ENV

- name: Build app
run: |
npm run build
npm run build:app

- name: Copy page index
run: cp test/support/index.html dist-app/

- name: Checkout gh-pages
run: git checkout gh-pages

- name: Add page to current directory
run: mv dist-app/* .

- name: Stage page for commit
run: git add restricted-input.js index.html

- name: Commit page
run: git commit -ve -m "Update demo page for restricted-input v${{ env.latest_version }}"

- name: Push changes
run: git push
9 changes: 6 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ concurrency: # prevent concurrent releases
cancel-in-progress: true

jobs:
ci-unit-tests:
uses: ./.github/workflows/ci-unit-tests.yml
ci:
uses: ./.github/workflows/ci.yml
bump-version:
needs: ci-unit-tests
needs: ci
uses: ./.github/workflows/version-bump.yml
with:
version_type: ${{ inputs.version_type }}
Expand All @@ -48,3 +48,6 @@ jobs:
publish-release:
needs: publish-npm
uses: ./.github/workflows/release-notes.yml
publish-gh-pages:
needs: publish-npm
uses: ./.github/workflows/publish-gh-pages.yml
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Restricted Input - Changelog

## Unreleased

- Update workflows and scripts
- move publish gh-pages action from script to workflow

## 4.1.2 (2025-02-25)

- Updates workflows and scripts
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
"test:unit": "jest test/unit",
"test:integration": "wdio wdio.conf.js",
"test:all": "npm run test && npm run test:integration",
"publish:demo": "./publish-gh-pages.sh",
"prepublishOnly": "npm run build && npm run build:app",
"postpublish": "npm run publish:demo"
"prepublishOnly": "npm run build && npm run build:app"
},
"dependencies": {
"@braintree/browser-detection": "^1.17.2"
Expand Down
20 changes: 0 additions & 20 deletions publish-gh-pages.sh

This file was deleted.

Loading