From b33267ddadc8b1093c50a92117c8eb1ea3487041 Mon Sep 17 00:00:00 2001 From: Lord Turmoil Date: Fri, 26 Jul 2024 12:57:05 +0800 Subject: [PATCH] update: deployment workflow --- .github/workflows/{deploy.yml => static.yml} | 29 +++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) rename .github/workflows/{deploy.yml => static.yml} (87%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/static.yml similarity index 87% rename from .github/workflows/deploy.yml rename to .github/workflows/static.yml index 641800d..c3884fb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/static.yml @@ -1,11 +1,9 @@ -# Simple workflow for deploying static content to GitHub Pages name: Deploy CodePaste on: - # Runs on pushes targeting the default branch push: - branches: ["release"] - + branches: ["main"] + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read @@ -19,11 +17,8 @@ concurrency: cancel-in-progress: false jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + # Build job to minify the project + build: runs-on: windows-latest steps: - name: Checkout @@ -39,21 +34,29 @@ jobs: npm install npm install html-minifier -g npm install uglify-js -g - + - name: Install Python uses: actions/setup-python@v2 with: python-version: "3.x" - + - name: Minify Project run: | .\minify.bat - + - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: 'dist' - + + # Deploy job to GitHub Pages + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: windows-latest + needs: build + steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4