From a8a4193b886cec61ef33347380a80a509885ddbd Mon Sep 17 00:00:00 2001 From: Abubakar <77960390+dev-ABsid@users.noreply.github.com> Date: Mon, 29 Jan 2024 09:23:49 +0500 Subject: [PATCH] Create deploy-documentation.yml --- .github/workflows/deploy-documentation.yml | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/deploy-documentation.yml diff --git a/.github/workflows/deploy-documentation.yml b/.github/workflows/deploy-documentation.yml new file mode 100644 index 0000000..6db4fbd --- /dev/null +++ b/.github/workflows/deploy-documentation.yml @@ -0,0 +1,54 @@ +# Workflow to build and deploy site to Vercel using Hugo + +# Name of Workflow +name: deploy-documentation + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the vercel-dev branch +on: + push: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "deploy" + deploy: + # The type of runner that the job will run on + runs-on: ubuntu-20.04 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Start Deployment + uses: bobheadxi/deployments@v0.4.3 + id: deployment + with: + step: start + token: ${{ secrets.GITHUB_TOKEN }} + env: Preview + + # Step 1 - Checks-out your repository under $GITHUB_WORKSPACE + - name: Checkout + uses: actions/checkout@v2 + + # Step 4 - Push our generated site to vercel + - name: Deploy to Vercel + uses: amondnet/vercel-action@v20 + id: vercel-action + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required + #github-token: ${{ secrets.GITHUB_TOKEN }} #Optional + vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required + github-comment: false + #vercel-args: '--prod' #Optional + working-directory: documentation + + - name: Update Deployment Status + uses: bobheadxi/deployments@v0.4.3 + if: always() + with: + step: finish + token: ${{ secrets.GITHUB_TOKEN }} + status: ${{ job.status }} + deployment_id: ${{ steps.deployment.outputs.deployment_id }} + env_url: ${{ steps.vercel-action.outputs.preview-url }}