From c22282e1bdc8c604c4a98da1372d6c51bf4ccdfa Mon Sep 17 00:00:00 2001 From: user0x42 Date: Thu, 27 Feb 2025 12:29:26 +0100 Subject: [PATCH] recreate vercel-deploy script --- .github/workflows/vercel-deploy.yml | 43 ++++++++++++++++++++++++++++ .github/workflows/vercel-preview.yml | 21 -------------- 2 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/vercel-deploy.yml delete mode 100644 .github/workflows/vercel-preview.yml diff --git a/.github/workflows/vercel-deploy.yml b/.github/workflows/vercel-deploy.yml new file mode 100644 index 0000000..ea01450 --- /dev/null +++ b/.github/workflows/vercel-deploy.yml @@ -0,0 +1,43 @@ +name: Build and Deploy with Vercel + +on: + push: + branches: + - main # Change if required + pull_request: + branches: + - main + +jobs: + build-and-deploy: + runs-on: docker + + steps: + - name: Checkout repository (including submodules) + uses: actions/checkout@v3 + with: + submodules: true + + - name: Set up Zola + run: | + ZOLA_VERSION="0.17.2" + curl -L -o zola.tar.gz "https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" + tar -xzf zola.tar.gz + chmod +x zola + sudo mv zola /usr/local/bin/zola + rm zola.tar.gz + + - name: Build Zola site + run: | + # Build the site (modify arguments if needed) + zola build + + - name: Deploy to Vercel + uses: amondnet/vercel-action@v20 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required + vercel-args: "--prod" # Deploy to production + working-directory: "." # Adjust if your site is in a subfolder + env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} # Required for Vercel action + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} # Required for Vercel action diff --git a/.github/workflows/vercel-preview.yml b/.github/workflows/vercel-preview.yml deleted file mode 100644 index ca1d713..0000000 --- a/.github/workflows/vercel-preview.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Vercel Preview Deployment -env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} -on: - push: - branches-ignore: - - master -jobs: - Deploy-Preview: - runs-on: docker - steps: - - uses: actions/checkout@v2 - - name: Install Vercel CLI - run: npm install --global vercel@latest - - name: Pull Vercel Environment Information - run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} - - name: Build Project Artifacts - run: vercel build --token=${{ secrets.VERCEL_TOKEN }} - - name: Deploy Project Artifacts to Vercel - run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}