Merge branch 'main' of https://github.com/MecSimCalc/MecSimCalc-docs #250
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
| # https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions | |
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v2 | |
| with: | |
| node-version: 18.x | |
| - name: Pull LFS files | |
| run: git lfs pull | |
| - name: Build | |
| env: | |
| GOOGLE_ANALYTICS: ${{ secrets.GOOGLE_ANALYTICS }} | |
| ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | |
| ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
| run: | | |
| npm ci | |
| npm run build | |
| # Popular action to deploy to GitHub Pages: | |
| # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # Build output to publish to the `gh-pages` branch: | |
| publish_dir: ./build | |
| # Assign commit authorship to the official GH-Actions bot for deploys to `gh-pages` branch: | |
| # https://github.com/actions/checkout/issues/13#issuecomment-724415212 | |
| # The GH actions bot is used by default if you didn't specify the two fields. | |
| # You can swap them out with your own user credentials. | |
| user_name: github-actions[bot] | |
| user_email: 41898282+github-actions[bot]@users.noreply.github.com | |
| algolia: | |
| name: Algolia Search | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Create env file | |
| run: | | |
| touch .env | |
| echo APPLICATION_ID=${{ secrets.ALGOLIA_APP_ID }} >> .env | |
| echo API_KEY=${{ secrets.ALGOLIA_API_KEY }} >> .env | |
| - name: "Crawler" | |
| run: docker run --env-file=.env -e "CONFIG=$(cat algolia.config.json | jq -r tostring)" algolia/docsearch-scraper | |
| langchain: | |
| name: Langchain DB | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src/scripts | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python 3.8 | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.8 | |
| - name: Install Python Dependencies | |
| run: pip install langchain==0.0.321 | |
| - name: Make Langchain DB | |
| run: | | |
| python make_langchain_db.py | |
| # Commit&Push: https://github.com/orgs/community/discussions/26672#discussioncomment-3252794 | |
| - name: Commit files | |
| id: commit | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "github-actions" | |
| git add --all | |
| if [ -z "$(git status --porcelain)" ]; then | |
| echo "::set-output name=push::false" | |
| else | |
| git commit -m "Add langchain_db.pkl" -a | |
| echo "::set-output name=push::true" | |
| fi | |
| - name: Push changes | |
| if: steps.commit.outputs.push == 'true' | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ github.ref }} |