From 041218a478f9fdf7e8e2a570ecde1b2b6141ffd9 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Sun, 10 Sep 2023 10:14:21 +0000 Subject: [PATCH] add build via CI --- .github/workflows/github-pages.yml | 35 ++++++++++++++++++++++++ .github/workflows/static.yml | 43 ------------------------------ package.json | 1 + 3 files changed, 36 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/github-pages.yml delete mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 0000000..be2a21c --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -0,0 +1,35 @@ +name: build 11ty site + +on: + push: + branches: ["main"] + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + - name: Install dependencies & build + run: | + npm ci + npm run build:prod + - uses: actions/upload-pages-artifact@v2 + with: + path: 'dist' + + deploy: + runs-on: ubuntu-latest + needs: build + steps: + - id: deployment + uses: actions/deploy-pages@v2 \ No newline at end of file diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml deleted file mode 100644 index 6ee98fb..0000000 --- a/.github/workflows/static.yml +++ /dev/null @@ -1,43 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - # Upload entire repository - path: '.' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 diff --git a/package.json b/package.json index 44b7c9e..9366764 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "", "main": "index.js", "scripts": { + "build:prod": "ELEVENTY_ENV=production eleventy", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [],