publish-event #140
This file contains hidden or 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: Kellerkind Build on Contentful Publish Event | |
| on: | |
| repository_dispatch: | |
| types: [publish-event] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-18.04 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup Node | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: '12.x' | |
| - name: Get npm cache directory | |
| id: npm-cache | |
| run: | | |
| echo "::set-output name=dir::$(npm config get cache)" | |
| - uses: actions/cache@v1 | |
| with: | |
| path: ${{ steps.npm-cache.outputs.dir }} | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Predeploy | |
| run: yarn predeploy | |
| env: | |
| CONTENTFUL_SPACE_ID: ${{ secrets.CONTENTFUL_SPACE_ID }} | |
| CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }} | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: public | |
| publish_branch: master | |
| cname: www.kellerkind.com |