From 26787b5a693dec40b773781d429982dfc29a6233 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 15 Nov 2024 18:23:19 +0100 Subject: [PATCH] build: release action that generates the index file --- .github/actions/prepare/action.yml | 14 ++++++++++++++ .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/actions/prepare/action.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml new file mode 100644 index 0000000..fecde69 --- /dev/null +++ b/.github/actions/prepare/action.yml @@ -0,0 +1,14 @@ +name: Prepare + +description: Checkout and install dependencies + +runs: + using: composite + steps: + - uses: actions/setup-node@v4 + with: + node-version: 22 + registry-url: 'https://registry.npmjs.org' + - name: Install dependencies + shell: bash + run: npm ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5a5fae8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +on: + release: + types: [published] + workflow_dispatch: + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + uses: ./.github/actions/prepare + + - name: Build + run: npm run build + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ./dist/index.html \ No newline at end of file