From bdea9cdd40d5eaf3f4167df8683ebb91f4b31f7f Mon Sep 17 00:00:00 2001 From: Brendan F Date: Thu, 9 Jan 2025 00:43:41 -0500 Subject: Move build to composite action --- .github/actions/build.yml | 18 ++++++++++++++++++ .github/workflows/build_website.yml | 14 +------------- .github/workflows/deploy_website.yml | 15 +-------------- 3 files changed, 20 insertions(+), 27 deletions(-) create mode 100644 .github/actions/build.yml diff --git a/.github/actions/build.yml b/.github/actions/build.yml new file mode 100644 index 0000000..d95d14d --- /dev/null +++ b/.github/actions/build.yml @@ -0,0 +1,18 @@ +name: Build Website +runs: + using: "composite" + steps: + - uses: actions/checkout@v4 + - name: Set Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: 'yarn' + - name: Run install + uses: borales/actions-yarn@v5 + with: + cmd: install # will run `yarn install` command + - name: Build production bundle + uses: borales/actions-yarn@v5 + with: + cmd: build diff --git a/.github/workflows/build_website.yml b/.github/workflows/build_website.yml index 00f6d2d..82e3b25 100644 --- a/.github/workflows/build_website.yml +++ b/.github/workflows/build_website.yml @@ -9,16 +9,4 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set Node.js - uses: actions/setup-node@v4 - with: - node-version: 20.x - - name: Run install - uses: borales/actions-yarn@v5 - with: - cmd: install # will run `yarn install` command - - name: Build production bundle - uses: borales/actions-yarn@v5 - with: - cmd: build + - uses: ./.github/actions/build.yml diff --git a/.github/workflows/deploy_website.yml b/.github/workflows/deploy_website.yml index b0bb438..3d8b790 100644 --- a/.github/workflows/deploy_website.yml +++ b/.github/workflows/deploy_website.yml @@ -29,20 +29,7 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set Node.js - uses: actions/setup-node@v4 - with: - node-version: 20.x - - name: Run install - uses: borales/actions-yarn@v5 - with: - cmd: install # will run `yarn install` command - - name: Build production bundle - uses: borales/actions-yarn@v5 - with: - cmd: build + - uses: ./.github/actions/build.yml - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: -- cgit v1.2.3