From e11fac3d11b728ccc2f799039a03ef04f1dec7ac Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Thu, 25 Sep 2025 14:03:51 +0200 Subject: [PATCH] Added deploy action for Localazy translations (#1014) * Added deploy action for Localazy translations * Fixed yml --- .github/workflows/localazy.yml | 41 ++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ localazy/localazy.json | 9 ++++++++ 3 files changed, 52 insertions(+) create mode 100644 .github/workflows/localazy.yml create mode 100644 localazy/localazy.json diff --git a/.github/workflows/localazy.yml b/.github/workflows/localazy.yml new file mode 100644 index 00000000..d3d0bed9 --- /dev/null +++ b/.github/workflows/localazy.yml @@ -0,0 +1,41 @@ +name: Deploy language files from localazy + +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Check out code from repo + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-north-1 + + - name: Generate localazy-keys.json + run: | + echo '{"writeKey": "", "readKey": "${{secrets.LOCALAZY_READ_KEY}}"}' > localazy/localazy-keys.json + + - name: Create localazy language folder + run: mkdir -p localazy/language + + - name: Install Localazy CLI + run: npm install -g @localazy/cli + + - name: Download translations + working-directory: localazy + run: localazy download -k localazy-keys.json + + - name: Upload translations to S3 + run: aws s3 sync ./localazy/language/ s3://amscloud-private/language/ diff --git a/.gitignore b/.gitignore index f843197a..b32f8837 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ platformio-user.ini node_modules /gui/dist /scripts/*dev +localazy-keys.json +localazy/language diff --git a/localazy/localazy.json b/localazy/localazy.json new file mode 100644 index 00000000..d02d48f6 --- /dev/null +++ b/localazy/localazy.json @@ -0,0 +1,9 @@ +{ + "upload": {}, + "download": { + "includeSourceLang": true, + "folder": "./language/", + "files": "${lang}.json" + }, + "transformations": [] +}