website.yml 1.8 KB

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