website.yml 1.9 KB

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