prefer dot notation #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Node.js CI | |
on: | |
push: | |
branches: [ "master" ] | |
paths: | |
- jqClock.js | |
pull_request: | |
branches: [ "master" ] | |
paths: | |
- jqClock.js | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Use Node.js LTS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: 'npm' | |
- name: Install google-closure-compiler | |
run: npm i -g google-closure-compiler | |
- name: Minify jqClock.js to jqClock.min.js | |
run: google-closure-compiler --js jqClock.js --js_output_file jqClock.min.js --language_in ECMASCRIPT_2019 --language_out ECMASCRIPT_2019 | |
- name: Update jqClock-lite.js based on current jqClock.js | |
run: | | |
cp jqClock.js jqClock-lite.js | |
perl -i -p0e 's/,\n options: \[\n(.*?)\n \}//s' jqClock-lite.js | |
- name: Minify jqClock-lite.js to jqClock-lite.min.js | |
run: google-closure-compiler --js jqClock-lite.js --js_output_file jqClock-lite.min.js --language_in ECMASCRIPT_2019 --language_out ECMASCRIPT_2019 | |
- name: Create Pull Request for Master | |
id: cpr-master | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
branch: generate-litejs-and-minify | |
- name: Check outputs | |
if: ${{ steps.cpr-master.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr-master.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr-master.outputs.pull-request-url }}" | |
- name: Create Pull Request for GH Pages | |
id: cpr-ghpages | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
branch: update-gh-pages | |
add-paths: | | |
*.js | |
base: gh-pages | |
- name: Check outputs | |
if: ${{ steps.cpr-ghpages.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr-ghpages.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr-ghpages.outputs.pull-request-url }}" |