diff --git a/actions/publish-vercel/action.yml b/actions/publish-vercel/action.yml new file mode 100644 index 0000000..23b7ddc --- /dev/null +++ b/actions/publish-vercel/action.yml @@ -0,0 +1,50 @@ +name: 'Vercel Publisher' +description: 'Builds and publishes documentation to vercel' + +branding: + icon: 'filter' + color: 'red' + +inputs: + VERCEL_TOKEN: + description: 'TOKEN to deploy to vercel' + required: false + VERCEL_ORG_ID: + description: 'The vercel organization id ' + required: false + VERCEL_PROJECT_ID: + description: 'The vercel project id' + required: false + +runs: + using: "composite" + steps: + - name: Build documentation + uses: elastic/docs-builder@main + + - name: "Create temp vercel.json file" + shell: bash + run: | + cat < vercel.json + { + "version": 2, + "public": false, + "github": { + "enabled": false + }, + "builds": [ + { "src": ".artifacts/docs/html", "use": "@vercel/static" } + ] + } + EOF + + - uses: amondnet/vercel-action@v25.2.0 #deploy + with: + vercel-token: ${{ inputs.VERCEL_TOKEN }} # Required + github-token: ${{ secrets.GITHUB_TOKEN }} #Optional + #vercel-args: '--prod' #Optional + vercel-org-id: ${{ inputs.VERCEL_ORG_ID}} #Required + vercel-project-id: ${{ inputs.VERCEL_PROJECT_ID}} #Required + working-directory: ./ + +