Retrieve docs from Contentful #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Retrieve docs from Contentful | |
on: | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: yarn | |
- name: Set up git | |
run: | | |
git config --global user.email "${GH_USERNAME}@users.noreply.github.com" | |
git config --global user.name "${GH_USERNAME}" | |
env: | |
GH_USERNAME: ${{ github.actor }} | |
- name: Retrieve documentation from Contentful | |
run: | | |
node index.js | |
env: | |
CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }} | |
- name: Stage changes | |
run: | | |
git add . | |
if: success() | |
- name: Commit changes | |
run: | | |
git commit -m "update documentation files using contentful" | |
if: success() | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
title: "Retrieve docs from Contentful" | |
branch: retrieve-docs-contentful | |
body: "This PR is generated when running the Retrieve docs from Contentful workflow. It contains the updated documentation files." | |
labels: "documentation" |