Skip to content

Commit

Permalink
On-demand dev builds for the contributor-docs branch (#18454)
Browse files Browse the repository at this point in the history
* Update on-demand-preview-build.yml

Move checkout Yari to before Install poetry dependencies

* Update on-demand-preview-build.yml

remove conditional checks
  • Loading branch information
Schalk Neethling committed Jul 17, 2022
1 parent ca39691 commit e7fed6b
Showing 1 changed file with 9 additions and 37 deletions.
46 changes: 9 additions & 37 deletions .github/workflows/on-demand-preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,8 @@ jobs:
- name: Install all yarn packages
run: |
yarn --frozen-lockfile
- name: Config git core.quotePath
run: |
# If you don't do this, the get-diff-action won't be able to
# notice files that contain non-ascii characters.
# I.e.
#
# ▶ git status
# Changes not staged for commit:
# ...
# modified: "files/en-us/glossary/b\303\251zier_curve/index.html"
#
# But after you set `core.quotePath` you get:
#
# ▶ git status
# Changes not staged for commit:
# ...
# modified: "files/en-us/glossary/bézier_curve/index.html"
#
# Now, this gets used by the `git diff ...` inside get-diff-action.
git config --global core.quotePath false
- uses: technote-space/get-diff-action@v6.1.0
id: git_diff_content
with:
PATTERNS: files/**/*.+(html|md)
SET_ENV_NAME: GIT_DIFF_CONTENT
- name: Build changed content
if: ${{ env.GIT_DIFF_CONTENT }}
- name: Build content
env:
CONTENT_ROOT: ${{ github.workspace }}/files

Expand Down Expand Up @@ -103,12 +76,11 @@ jobs:
# you don't need that script as a writer. It's only used in CI
# and it can't use the default CONTENT_ROOT that gets set in
# package.json.
yarn build ${{ env.GIT_DIFF_CONTENT }}
yarn build
echo "Disk usage size of build/"
du -sh $BUILD_OUT_ROOT
- name: Merge static assets with built documents
if: ${{ env.GIT_DIFF_CONTENT }}
run: |
rsync -a node_modules/@mdn/yari/client/build/ build/
# Now that build/ directory contains everything you need to deploy
Expand Down Expand Up @@ -159,19 +131,19 @@ jobs:
with:
path: yari/deployer/.venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/pr-review-companion.yml') }}

- name: Checkout Yari
uses: actions/checkout@v3
with:
repository: mdn/yari
path: yari

- name: Install poetry dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
cd yari/deployer
poetry install --no-interaction --no-root
- name: Checkout Yari
uses: actions/checkout@v3
with:
repository: mdn/yari
path: yari

- name: Install Deployer
run: |
cd yari/deployer
Expand All @@ -195,4 +167,4 @@ jobs:
poetry run deployer upload \
--prefix="$DEPLOYMENT_PREIFIX" \
--default-cache-control 0 \
"$BUILD_OUT_ROOT"
"$BUILD_OUT_ROOT"

0 comments on commit e7fed6b

Please sign in to comment.