From ac60da7480aa0bd62d1867fa254c99ba56bed058 Mon Sep 17 00:00:00 2001 From: Hasan Haghniya Date: Sat, 23 Mar 2024 11:45:04 +0330 Subject: [PATCH 1/2] allow trigger workflow with webhook --- .github/workflows/.deploy.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/.deploy.yml b/.github/workflows/.deploy.yml index 1b8e453..cdefd66 100644 --- a/.github/workflows/.deploy.yml +++ b/.github/workflows/.deploy.yml @@ -1,18 +1,15 @@ -# Sample workflow for building and deploying a Next.js site to GitHub Pages -# -# To get started with Next.js see: https://nextjs.org/docs/getting-started -# name: Deploy Next.js site 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 + repository_dispatch: + types: + - webhook + permissions: contents: read pages: write @@ -25,7 +22,6 @@ concurrency: cancel-in-progress: false jobs: - # Build job build: runs-on: ubuntu-latest steps: @@ -64,9 +60,7 @@ jobs: with: path: | .next/cache - # Generate a new cache whenever packages or source files change. key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} - # If source files changed but packages didn't, rebuild from a prior cache. restore-keys: | ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- @@ -81,7 +75,6 @@ jobs: with: path: ./out - # Deployment job deploy: environment: name: github-pages From b6e6ff6107ef9ec2cf811299addce6c714f91027 Mon Sep 17 00:00:00 2001 From: Hasan Haghniya Date: Sat, 23 Mar 2024 11:58:37 +0330 Subject: [PATCH 2/2] Rename .deploy.yml to deploy.yml --- .github/workflows/{.deploy.yml => deploy.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{.deploy.yml => deploy.yml} (98%) diff --git a/.github/workflows/.deploy.yml b/.github/workflows/deploy.yml similarity index 98% rename from .github/workflows/.deploy.yml rename to .github/workflows/deploy.yml index cdefd66..5f83184 100644 --- a/.github/workflows/.deploy.yml +++ b/.github/workflows/deploy.yml @@ -84,4 +84,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4