[📥️] Download #3801
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: '[📥️] Download' | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 8-18/2 * * 1-5' # At minute 0 past every 2nd hour from 8 through 18 on every day-of-week from Monday through Friday. | |
- cron: '0 0 * * *' # Every day at midnight | |
jobs: | |
download: | |
name: '[📥️] Download' | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Set yarn version to latest stable | |
run: | | |
corepack enable | |
yarn set version latest | |
- name: Get yarn cache directory path | |
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- name: Restore Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ steps.yarn_cache_dir.outputs.dir }} | |
**/node_modules | |
**/.eslintcache | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: | | |
yarn install --immutable | |
- name: Run Download Script on Mexico | |
env: | |
GAME: https://centro-de-mando.mx | |
run: | | |
yarn download | |
- name: Run Download Script | |
run: | | |
yarn download | |
- name: Run prettier | |
run: | | |
yarn prettier:write | |
- name: Show changes | |
run: | | |
git status | |
git --no-pager diff --color-words | |
- name: Create diff to mx version | |
run: | | |
set -e | |
git --no-pager diff --no-index application.js application.alt.js | tee alt_js.diff || true | |
git --no-pager diff --no-index application.css application.alt.css |tee alt_css.diff || true | |
exit 0 | |
- name: Check if there are changes | |
run: | | |
echo "CHANGED_FILES=$(git status -s | wc -l)" >> $GITHUB_ENV | |
- name: Commit & Push changes | |
if: github.ref == 'refs/heads/master' && env.CHANGED_FILES > 1 | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
message: 'automated update' | |
branch: 'master' |