aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/pr-check_redirects.yml1
-rw-r--r--.github/workflows/pr-test.yml17
-rw-r--r--.github/workflows/sync-translated-content.yml23
3 files changed, 24 insertions, 17 deletions
diff --git a/.github/workflows/pr-check_redirects.yml b/.github/workflows/pr-check_redirects.yml
index 05f463bc57..43b7f6e50f 100644
--- a/.github/workflows/pr-check_redirects.yml
+++ b/.github/workflows/pr-check_redirects.yml
@@ -29,6 +29,7 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
+
- uses: actions/cache@v2.1.4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml
index af6fada9aa..be61826133 100644
--- a/.github/workflows/pr-test.yml
+++ b/.github/workflows/pr-test.yml
@@ -33,16 +33,19 @@ jobs:
with:
node-version: "12"
- - name: Cache node_modules
- uses: actions/cache@v2.1.4
- id: cached-node_modules
+ - name: Get yarn cache directory path
+ id: yarn-cache-dir-path
+ run: echo "::set-output name=dir::$(yarn cache dir)"
+
+ - uses: actions/cache@v2.1.4
+ id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
- path: |
- {{ github.workspace }}/mdn/content/node_modules
- key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-1
+ path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+ key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-yarn-
- name: Install all yarn packages
- if: steps.cached-node_modules.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/mdn/content
run: |
yarn --frozen-lockfile
diff --git a/.github/workflows/sync-translated-content.yml b/.github/workflows/sync-translated-content.yml
index 4516c68c7c..f47e7f6e5c 100644
--- a/.github/workflows/sync-translated-content.yml
+++ b/.github/workflows/sync-translated-content.yml
@@ -28,21 +28,24 @@ jobs:
with:
node-version: "12"
- - name: Cache node_modules
- uses: actions/cache@v2.1.4
- id: cached-node_modules
+ - name: Get yarn cache directory path
+ id: yarn-cache-dir-path
+ run: echo "::set-output name=dir::$(yarn cache dir)"
+
+ - uses: actions/cache@v2.1.4
+ id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
- path: |
- **/node_modules
- key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
+ path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+ key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-yarn-
- name: Install all yarn packages
- if: steps.cached-node_modules.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/mdn/content
run: |
yarn --frozen-lockfile
- - name: Build changed content
+ - name: Sync translated content
env:
CONTENT_ROOT: ${{ github.workspace }}/mdn/content/files
CONTENT_TRANSLATED_ROOT: ${{ github.workspace }}/files
@@ -58,6 +61,6 @@ jobs:
git remote add upstream "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git config --local user.email "actions@users.noreply.github.com"
git config --local user.name "MDN"
- git commit -a -m "[CRON] sync translated content"
- git pull --rebase upstream main
+ git commit -a -m "[CRON] sync translated content" && \
+ git pull --rebase upstream main && \
git push upstream main