Skip to content

(Testing Github Actions) Fix multiline #9

(Testing Github Actions) Fix multiline

(Testing Github Actions) Fix multiline #9

Workflow file for this run

name: Vercel Production Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- master
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Inject API token into vercel config
uses: sergeysova/jq-action@v2
id: rewrites
with:
cmd: jq '.|.rewrites[0].has[0].value="Bearer ${{ secrets.PUB_LYCHEE_KEY }}"|.rewrites[0].destination="${{ secrets.LYCHEE_BASE_URL }}"' vercel.json > tmpvercel.json && mv tmpvercel.json vercel.json
- name: Temp Test Output
uses: sergeysova/jq-action@v2
id: testOutput
with:
cmd: 'cat vercel.json | jq ".rewrites"'
multiline: true
- name: Temp Read Vercel Config
run: |
content=`cat vercel.json`
# the following lines are only required for multi line json (https://stackoverflow.com/a/61919791)
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=packageJson::$content"
- run: |
echo "${{fromJson(steps.set_var.outputs.packageJson).version}}"
- name: Install Vercel CLI
run: npm install --global vercel
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}