website.yml 1.8 KB

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