website.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: Deploy uppy.io
  2. on:
  3. push:
  4. branches: main
  5. jobs:
  6. deploy:
  7. name: Deploy
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout sources
  11. uses: actions/checkout@v3
  12. - name: Get yarn cache directory path
  13. id: yarn-cache-dir-path
  14. run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"
  15. - uses: actions/cache@v3
  16. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  17. with:
  18. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  19. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  20. restore-keys: |
  21. ${{ runner.os }}-yarn-
  22. - name: Install Node.js
  23. uses: actions/setup-node@v3
  24. with:
  25. node-version: lts/*
  26. - name: Install dependencies
  27. run: corepack yarn install --immutable
  28. - name: Build Uppy
  29. run: corepack yarn run build
  30. - name: Build website
  31. run: corepack yarn run web:build
  32. - name: Prepare deployment
  33. run: corepack yarn run web:prepare-deploy --quiet
  34. env:
  35. DEPLOY_DIR: ${{github.workspace}}/_deploy
  36. - name: Push to Github Pages
  37. uses: crazy-max/ghaction-github-pages@v2
  38. with:
  39. target_branch: gh-pages
  40. build_dir: _deploy # relative to `github.workspace`
  41. committer: 'Uppy Bot <uppybot@uppy.io>'
  42. author: 'Uppy Bot <uppybot@uppy.io>'
  43. commit_message: Update transloadit/uppy website
  44. fqdn: uppy.io
  45. jekyll: false
  46. env:
  47. GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}