From 9574888f473bbec95df54e143ab66a0dc6c23838 Mon Sep 17 00:00:00 2001 From: Fernando Arteaga Date: Sat, 3 Feb 2024 11:29:12 -0500 Subject: [PATCH] revert --- .github/actions/setup-runtime.yaml | 16 ++++++ .github/workflows/publish.yaml | 91 ++++++++---------------------- 2 files changed, 40 insertions(+), 67 deletions(-) create mode 100644 .github/actions/setup-runtime.yaml diff --git a/.github/actions/setup-runtime.yaml b/.github/actions/setup-runtime.yaml new file mode 100644 index 0000000..1eda80f --- /dev/null +++ b/.github/actions/setup-runtime.yaml @@ -0,0 +1,16 @@ +name: Setup Node.js and pnpm + +runs: + using: "composite" + steps: + - name: "Setup pnpm" + uses: pnpm/action-setup@v2 + id: pnpm-install + with: + version: 8 + run_install: false + - name: "Setup Node" + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index b78cf7e..832d00b 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -18,83 +18,40 @@ concurrency: env: BUILD_PATH: "." -#jobs: -# build: -# name: "Build" -# runs-on: ubuntu-latest -# steps: -# - name: "Checkout" -# uses: actions/checkout@v4 -# - name: "Setup pnpm" -# uses: pnpm/action-setup@v2 -# with: -# version: 8 -# run_install: false -# - name: "Setup Node" -# uses: actions/setup-node@v4 -# with: -# node-version: "20" -# cache: 'pnpm' -# - name: "Get pnpm store directory" -# shell: bash -# run: | -# echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV -# - name: "Setup pnpm cache" -# uses: actions/cache@v4 -# with: -# path: ${{ env.STORE_PATH }} -# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} -# restore-keys: | -# ${{ runner.os }}-pnpm-store- -# - name: "Setup Pages" -# id: pages -# uses: actions/configure-pages@v4 -# - name: "Install dependencies" -# run: pnpm install -# working-directory: ${{ env.BUILD_PATH }} -# - name: "Build with Astro" -# run: | -# pnpx astro build \ -# --site "${{ steps.pages.outputs.origin }}" \ -# --base "${{ steps.pages.outputs.base_path }}" -# working-directory: ${{ env.BUILD_PATH }} -# - name: "Upload artifact" -# uses: actions/upload-pages-artifact@v3 -# with: -# path: ${{ env.BUILD_PATH }}/dist -# -# deploy: -# environment: -# name: github-pages -# url: ${{ steps.deployment.outputs.page_url }} -# needs: build -# runs-on: ubuntu-latest -# name: "Deploy" -# steps: -# - name: "Deploy to GitHub Pages" -# id: deployment -# uses: actions/deploy-pages@v4 - jobs: build: + name: "Build" runs-on: ubuntu-latest steps: - - name: Checkout your repository using git + - name: "Checkout" uses: actions/checkout@v4 - - name: Install, build, and upload your site - uses: withastro/action@v1 + - name: "Setup runtime" + uses: ./.github/actions/setup-runtime + - name: "Setup Pages" + id: pages + uses: actions/configure-pages@v4 + - name: "Install dependencies" + run: pnpm install + working-directory: ${{ env.BUILD_PATH }} + - run: | + echo origin: ${{ steps.pages.outputs.origin }} + echo base_path: ${{ steps.pages.outputs.base_path }} + - name: "Build with Astro" + run: pnpm run build + working-directory: ${{ env.BUILD_PATH }} + - name: "Upload artifact" + uses: actions/upload-pages-artifact@v3 with: - path: . - node-version: 20 - package-manager: pnpm@8 + path: ${{ env.BUILD_PATH }}/dist deploy: - needs: build - runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + name: "Deploy" steps: - - name: Deploy to GitHub Pages + - name: "Deploy to GitHub Pages" id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4