Sync calc only #26
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: Sync calc only | |
on: | |
# schedule: | |
# - cron: '0 * * * *' | |
# - cron: '*/5 15 * * 2' | |
# - cron: '45 7 * * *' | |
workflow_dispatch: | |
env: | |
PLAYER_EN_USERNAME: ${{ secrets.PLAYER_EN_USERNAME }} | |
PLAYER_EN_PASSWORD: ${{ secrets.PLAYER_EN_PASSWORD }} | |
PLAYER_FR_USERNAME: ${{ secrets.PLAYER_FR_USERNAME }} | |
PLAYER_FR_PASSWORD: ${{ secrets.PLAYER_FR_PASSWORD }} | |
PLAYER_DE_USERNAME: ${{ secrets.PLAYER_DE_USERNAME }} | |
PLAYER_DE_PASSWORD: ${{ secrets.PLAYER_DE_PASSWORD }} | |
PLAYER_SP_USERNAME: ${{ secrets.PLAYER_SP_USERNAME }} | |
PLAYER_SP_PASSWORD: ${{ secrets.PLAYER_SP_PASSWORD }} | |
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
GOOGLE_API_KEY_2: ${{ secrets.GOOGLE_API_KEY_2 }} | |
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} | |
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} | |
GUILD_ID: ${{ secrets.GUILD_ID }} | |
GDOCS_TOKEN: ${{ secrets.GDOCS_TOKEN }} | |
REGENERATE_KEYSTONES: "true" | |
EXIT_IF_NO_NEW_CREW: ${{ github.event.inputs.ONLY_SYNC_NEW_CREW != 'false' && github.event.schedule != '45 7 * * *' }} | |
NODE_TLS_REJECT_UNAUTHORIZED: "0" | |
BBSECRET: ${{ secrets.BBSECRET }} | |
NODE_ENV: development | |
# YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
jobs: | |
# Checkout all repos | |
Sync-Calc-Only: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Update system package list | |
run: sudo apt update | |
- name: Install system packages | |
run: sudo apt install zip bash | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Website - Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: stt-datacore/website | |
# Remove this for prod!!! | |
ref: beta | |
token: ${{ secrets.GH_ACCESS_TOKEN }} | |
path: website | |
- name: Scripts - Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: stt-datacore/scripts | |
token: ${{ secrets.GH_ACCESS_TOKEN }} | |
path: scripts | |
- name: DataScore - Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: stt-datacore/datascore | |
token: ${{ secrets.GH_ACCESS_TOKEN }} | |
path: datascore | |
- name: Website - Check for changes | |
id: changes | |
run: | | |
if [[ `git status --porcelain` ]]; then | |
echo "::set-output name=changes::true" | |
else | |
echo "::set-output name=changes::false" | |
fi | |
working-directory: website | |
- name: Website - yarn install | |
run: yarn install | |
working-directory: website | |
- name: Website - precalculate | |
run: npm run precalculate | |
working-directory: website | |
- name: Datascore - yarn install | |
run: yarn install | |
working-directory: datascore | |
- name: Datascore - calculate | |
id: datascore | |
run: | | |
bash calc.sh | |
cat ./battle_run_report.txt | |
working-directory: datascore | |
- name: Website - Commit and push changes | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "Autosync Datascore" | |
git pull --rebase || true | |
git push | |
working-directory: website | |
- name: Scripts - Commit and push changes, if any | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "Autosync Datascore" || true | |
git pull --rebase || true | |
git push | |
working-directory: scripts |