From 25bc0f1bc3cb01ae4af8b6bb02313855544a9422 Mon Sep 17 00:00:00 2001 From: Tamotsu Takahashi Date: Thu, 7 Dec 2023 16:59:43 +0900 Subject: [PATCH] Add workflow to minify --- .github/workflows/main.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..033f497 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,30 @@ +name: Minify with terser +on: + push: + paths: + - 'coi-serviceworker.js' +permissions: + contents: write +jobs: + minify: + name: minify + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup node + uses: actions/setup-node@v3 + - name: install deps + run: npm ci + - name: minify + run: npm run minify + - name: commit and push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add . + git commit -m "Minify" + git push origin HEAD:${GITHUB_REF}