diff --git a/.forgejo/actions/renovate/action.yaml b/.forgejo/actions/renovate/action.yaml index 8cba3a6..d2a2901 100644 --- a/.forgejo/actions/renovate/action.yaml +++ b/.forgejo/actions/renovate/action.yaml @@ -12,25 +12,35 @@ inputs: github-token: description: 'GitHub Token' required: true + github-username: + description: 'GitHub Username' + required: true + docker-username: + description: 'Docker Hub Username' + required: true + docker-password: + description: 'Docker Hub Password' + required: true args: description: 'Renovate Args' required: false default: '' - save-cache: - description: 'Save cache' - required: false - default: 'false' runs: using: 'composite' steps: - - uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + - name: Cache Renovate + uses: https://code.forgejo.org/actions/cache@v4.2.0 with: path: | .tmp/cache/renovate/repository - key: renovate-cache-${{ inputs.endpoint }}-${{ github.run_id }} + key: renovate-${{ inputs.endpoint }}-${{ github.run_id }} restore-keys: | - renovate-cache-${{ inputs.endpoint }}- + renovate-${{ inputs.endpoint }}- + compression: true + timeout: 900000 + retry: 5 + retry-wait: 5000 - run: | renovate ${{ inputs.args }} @@ -44,17 +54,13 @@ runs: RENOVATE_PLATFORM: gitea RENOVATE_REPOSITORY_CACHE: 'enabled' RENOVATE_TOKEN: ${{ inputs.token }} - RENOVATE_HOST_RULES: '[{"matchHost":"docker.io","username":"${{ env.DOCKER_USERNAME }}","password":"${{ env.DOCKER_PASSWORD }}"}]' - + RENOVATE_HOST_RULES: |- + [ + {"matchHost":"docker.io","hostType":"docker","username":"${{ inputs.docker-username }}","password":"${{ inputs.docker-password }}"}, + {"matchHost":"ghcr.io","hostType":"docker","username":"${{ inputs.github-username }}","password":"${{ inputs.github-token }}"} + {"matchHost":"github.com","hostType":"github","token":"${{ inputs.github-token }}"}, + ] GIT_AUTHOR_NAME: 'Renovate Bot' GIT_AUTHOR_EMAIL: 'smeagol@hsn.dev' GIT_COMMITTER_NAME: 'Renovate Bot' GIT_COMMITTER_EMAIL: 'smeagol@hsn.dev' - - - name: Save renovate repo cache - if: always() && inputs.save-cache == 'true' - uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 - with: - path: | - .tmp/cache/renovate/repository - key: renovate-cache-${{ inputs.endpoint }}-${{ github.run_id }} diff --git a/.forgejo/workflows/renovate.yaml b/.forgejo/workflows/renovate.yaml index 05dab72..57b08ef 100644 --- a/.forgejo/workflows/renovate.yaml +++ b/.forgejo/workflows/renovate.yaml @@ -13,8 +13,7 @@ on: type: boolean env: RENOVATE_DRY_RUN: "${{ inputs.dryRun == true }}" - DOCKER_USERNAME: "${{ secrets.DOCKER_USERNAME }}" - DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" + jobs: renovate: name: Renovate @@ -26,26 +25,13 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: show-progress: false - - name: setup .ssh directory - run: mkdir -p /home/ubuntu/.ssh && chmod 700 /home/ubuntu/.ssh - - name: Write ssh key - id: sshkey - uses: https://github.com/timheuer/base64-to-file@adaa40c0c581f276132199d4cf60afa07ce60eac # v1 - # uses: timheuer/base64-to-file@adaa40c0c581f276132199d4cf60afa07ce60eac # v1 - with: - encodedString: "${{ secrets.SSH_USER }}" - fileName: id_ed25519 - fileDir: /home/ubuntu/.ssh - - name: chmod id_ed25519 - run: chmod 600 /home/ubuntu/.ssh/id_ed25519 - name: Renovate uses: ./.forgejo/actions/renovate with: endpoint: https://git.hsn.dev/api/v1/ token: ${{ secrets.RENOVATE_TOKEN }} github-token: ${{ secrets.GH_TOKEN }} + github-username: ${{ secrets.GH_USERNAME }} + docker-username: ${{ secrets.DOCKER_USERNAME }} + docker-password: ${{ secrets.DOCKER_PASSWORD }} args: --platform gitea --autodiscover - save-cache: true - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}