From 7b91b1be0c33d9e1ddda924c6f58eba08137662c Mon Sep 17 00:00:00 2001 From: Priyantha Buddhika Date: Sat, 13 Aug 2022 21:52:44 +0530 Subject: [PATCH 1/8] vercel action created --- .github/workflows/pull_request.yml | 19 +++++++++++++++++++ .gitignore | 1 + vercel.json | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 .github/workflows/pull_request.yml create mode 100644 vercel.json diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..4a27299 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,19 @@ +name: deploy website +on: [pull_request] +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: amondnet/vercel-action@v19 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required + github-token: ${{ secrets.TOKEN_GITHUB_ACTION }} #Optional + # vercel-args: '--prod' #Optional + vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required + github-comment: true + # working-directory: ./sub-directory #Your Working Directory, Optional + # alias-domains: | #Optional + # staging.angular.vercel-action.amond.dev + # pr-{{PR_NUMBER}}.angular.vercel-action.amond.dev \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4d29575..0846f83 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +.vercel diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..c797f83 --- /dev/null +++ b/vercel.json @@ -0,0 +1,10 @@ +{ + "version": 2, + "public": false, + "github": { + "enabled": false + }, + "builds": [ + { "src": "./build/**", "use": "@vercel/static" } + ] +} \ No newline at end of file From 18334c3453c53317cf6e526cd3cd8eed34ec98cf Mon Sep 17 00:00:00 2001 From: Priyantha Buddhika Date: Sat, 13 Aug 2022 21:54:19 +0530 Subject: [PATCH 2/8] Minor change --- .github/workflows/pull_request.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 4a27299..222a38d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,5 +1,8 @@ name: deploy website -on: [pull_request] +on: + pull_request: + branches: + - development jobs: deploy: runs-on: ubuntu-latest @@ -8,12 +11,12 @@ jobs: - uses: amondnet/vercel-action@v19 with: vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required - github-token: ${{ secrets.TOKEN_GITHUB_ACTION }} #Optional + github-token: ${{ secrets.TOKEN_GITHUB_ACTION }} #Optional # vercel-args: '--prod' #Optional - vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required - vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required + vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required github-comment: true # working-directory: ./sub-directory #Your Working Directory, Optional # alias-domains: | #Optional # staging.angular.vercel-action.amond.dev - # pr-{{PR_NUMBER}}.angular.vercel-action.amond.dev \ No newline at end of file + # pr-{{PR_NUMBER}}.angular.vercel-action.amond.dev From 981fa43a6bf17a448dc179bb12308c9fc86a9963 Mon Sep 17 00:00:00 2001 From: Priyantha Buddhika Date: Sat, 13 Aug 2022 21:54:30 +0530 Subject: [PATCH 3/8] Minor change --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 222a38d..d68f638 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -2,7 +2,7 @@ name: deploy website on: pull_request: branches: - - development + - main jobs: deploy: runs-on: ubuntu-latest From 51d10d56fd568235d9d463a06b4f9f0936b25445 Mon Sep 17 00:00:00 2001 From: Priyantha Buddhika Date: Sat, 13 Aug 2022 21:58:50 +0530 Subject: [PATCH 4/8] Added build step to the workflow --- .github/workflows/pull_request.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d68f638..49e2a52 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,8 +6,35 @@ on: jobs: deploy: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + + - name: Set up Node version + uses: actions/setup-node@v3 + with: + node-version: 16.13.2 + + - name: Install project dependencies + id: npm-install + run: npm install + + - name: Build the project with npm + id: npm-build + run: npm run build-testing + + - name: Comment PR if tests have been failed + if: failure() + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Build failed! Please review your changes again' + }) + - uses: amondnet/vercel-action@v19 with: vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required From 6c5bb4b51f3299ccc048d42468ed873dcab9d820 Mon Sep 17 00:00:00 2001 From: Priyantha Buddhika Date: Sat, 13 Aug 2022 22:00:24 +0530 Subject: [PATCH 5/8] Minor change --- .github/workflows/pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 49e2a52..49258a4 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -21,7 +21,7 @@ jobs: - name: Build the project with npm id: npm-build - run: npm run build-testing + run: npm run build - name: Comment PR if tests have been failed if: failure() @@ -34,7 +34,7 @@ jobs: repo: context.repo.repo, body: 'Build failed! Please review your changes again' }) - + - uses: amondnet/vercel-action@v19 with: vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required From 276c3a5fb4c5ebd57f8b9f9271a450d2db0346ed Mon Sep 17 00:00:00 2001 From: Priyantha Buddhika Date: Sat, 13 Aug 2022 22:11:23 +0530 Subject: [PATCH 6/8] Minor change --- vercel.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/vercel.json b/vercel.json index c797f83..cbf9828 100644 --- a/vercel.json +++ b/vercel.json @@ -3,8 +3,5 @@ "public": false, "github": { "enabled": false - }, - "builds": [ - { "src": "./build/**", "use": "@vercel/static" } - ] + } } \ No newline at end of file From 476ab1f86e7978487b88491d47e333c7cdd8d727 Mon Sep 17 00:00:00 2001 From: Priyantha Buddhika Date: Sat, 13 Aug 2022 22:16:34 +0530 Subject: [PATCH 7/8] Minor change --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 49258a4..8206f75 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -43,7 +43,7 @@ jobs: vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required github-comment: true - # working-directory: ./sub-directory #Your Working Directory, Optional + # working-directory: ./build/ #Your Working Directory, Optional # alias-domains: | #Optional # staging.angular.vercel-action.amond.dev # pr-{{PR_NUMBER}}.angular.vercel-action.amond.dev From a0f10ba97461a653957eddbbe72d2fc6039b22c9 Mon Sep 17 00:00:00 2001 From: Priyantha Buddhika Date: Sat, 13 Aug 2022 22:20:54 +0530 Subject: [PATCH 8/8] Minor change --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8206f75..9219bd6 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -43,7 +43,7 @@ jobs: vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required github-comment: true - # working-directory: ./build/ #Your Working Directory, Optional + working-directory: ./build/ #Your Working Directory, Optional # alias-domains: | #Optional # staging.angular.vercel-action.amond.dev # pr-{{PR_NUMBER}}.angular.vercel-action.amond.dev