Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Publishing JAM Stack Web Apps with GitOps and GitHub Actions
name: Pull Request
on:
pull_request:
branches:
- dev
types:
- opened
jobs:
schedule_publish:
name: Schedule publish
runs-on: ubuntu-latest
steps:
- name: Check event payload
shell: bash
run: |
echo ${{ toJSON(github.event) }}
- name: Check pr body
id: prbody
shell: bash
run: |
echo ::set-output name=published::$(echo ${{ toJSON(github.event.pull_request.body) }} | sed 's!published: !!g' | sed 's!\\r\\n!!g')
- name: Check environment variables
shell: bash
run: |
echo "Published: ${{ steps.prbody.outputs.published }}"
- name: Schedule publish
shell: bash
run: |
curl -X POST 'https://${{ secrets.AZURE_FUNCTIONS_NAME }}.azurewebsites.net/api/orchestrators/schedule-event' \
-d '{ "owner": "aliencube", "repository": "blog", "issueId": ${{ github.event.pull_request.number }}, "schedule": "${{ steps.prbody.outputs.published }}" }} }' \
-H "x-functions-key: ${{ secrets.AZURE_FUNCTIONS_KEY }}" \
-H "Content-Type: application/json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.