Autoupdate #961
This file contains hidden or 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: Autoupdate | |
| on: | |
| schedule: | |
| - cron: "0 1 * * *" | |
| workflow_dispatch: | |
| workflow_call: | |
| concurrency: | |
| group: "${{ github.workflow }} @ ${{ github.ref }}" | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| actions: write | |
| jobs: | |
| update: | |
| env: | |
| SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT }} | |
| NODE_VERSION: 22 | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| outputs: | |
| updated: ${{ steps.autoupdate.outputs.updated }} | |
| version: ${{ steps.autoupdate.outputs.version }} | |
| steps: | |
| - name: Сheckout repo | |
| id: checkout_repo | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: "master" | |
| path: "tmp" | |
| - name: Set service account | |
| id: set_service_account | |
| run: echo $SERVICE_ACCOUNT>serviceAccount.json | |
| working-directory: ${{ github.workspace }}/tmp | |
| - name: Set up JDK 21 | |
| id: setup_java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| id: setup_node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Cache node modules | |
| id: use_cache | |
| uses: actions/cache@v5 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - name: Install global dependencies | |
| id: install_global | |
| run: npm install firebase-tools -g | |
| - name: Autoupdate | |
| id: autoupdate | |
| uses: siarheidudko/autoupdater@v3 | |
| with: | |
| author-email: "slavianich@gmail.com" | |
| author-name: "Siarhei Dudko" | |
| working-directory: ${{ github.workspace }}/tmp | |
| ref: ${{ github.repository }} | |
| builds-and-checks: | | |
| npm run lint | |
| npm run build | |
| npm run cov | |
| bash hosting.sh | |
| git add --all | |
| git commit -m 'hosting' | |
| ignore-packages: | | |
| @types/node | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: update | |
| if: needs.update.outputs.updated == 'true' | |
| steps: | |
| - name: Trigger Build and Deploy Workflow | |
| uses: benc-uk/workflow-dispatch@v1 | |
| with: | |
| workflow: build-and-deploy.yml | |
| ref: master | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| inputs: '{ "tag": "${{ needs.update.outputs.version }}" }' |