66 lines
1.4 KiB
YAML
66 lines
1.4 KiB
YAML
name: Translations
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "30 0 * * *"
|
|
push:
|
|
branches:
|
|
- dev
|
|
paths:
|
|
- src/translations/en.json
|
|
|
|
env:
|
|
NODE_VERSION: 12
|
|
|
|
jobs:
|
|
upload:
|
|
name: Upload
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Node ${{ env.NODE_VERSION }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Upload Translations
|
|
run: |
|
|
export LOKALISE_TOKEN="${{ secrets.LOKALISE_TOKEN }}"
|
|
|
|
./script/translations_upload_base
|
|
|
|
download:
|
|
name: Download
|
|
needs: upload
|
|
if: github.event_name == 'schedule'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Node ${{ env.NODE_VERSION }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Download Translations
|
|
run: |
|
|
export LOKALISE_TOKEN="${{ secrets.LOKALISE_TOKEN }}"
|
|
|
|
npm install
|
|
./script/translations_download
|
|
|
|
- name: Initialize git
|
|
uses: home-assistant/actions/helpers/git-init@master
|
|
with:
|
|
name: GitHub Action
|
|
email: github-action@users.noreply.github.com
|
|
|
|
- name: Update translation
|
|
run: |
|
|
git add translations
|
|
git commit -am "Translation update"
|
|
git push
|