docs #168
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: docs | |
on: | |
push: | |
branches: | |
- master | |
- docs-v2 | |
workflow_dispatch: | |
jobs: | |
build: | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
with: | |
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
- name: Use Node.js 16 | |
uses: actions/setup-node@v2-beta | |
with: | |
node-version: 16 | |
- name: Set git identity | |
run: | | |
git config --global user.name "Martin Adámek" | |
git config --global user.email "[email protected]" | |
# - name: Cache node_modules | |
# uses: actions/cache@v2 | |
# with: | |
# path: '**/node_modules' | |
# key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Build & deploy docs | |
run: | | |
# install project deps | |
npm ci --force | |
# go to website dir | |
cd website | |
# install website deps | |
npm ci --force | |
# install the latest theme version | |
npm update @apify/docs-theme | |
# build and deploy the docs | |
npm run deploy | |
env: | |
GIT_USER: "B4nan:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}" | |
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
- name: Commit the updated package(-lock).json | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 'chore: Automatic theme updating workflow [skip ci]' | |
file_pattern: 'website/package*.json' | |
commit_user_name: Apify Bot | |
commit_user_email: [email protected] | |
commit_author: Apify Bot <[email protected]> | |
- name: Invalidate CloudFront cache | |
run: gh workflow run invalidate.yaml --repo apify/apify-docs-private | |
env: | |
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} |