This commit is contained in:
parent
e15ed7dd18
commit
64a4019b66
2 changed files with 27 additions and 35 deletions
|
@ -12,25 +12,35 @@ inputs:
|
||||||
github-token:
|
github-token:
|
||||||
description: 'GitHub Token'
|
description: 'GitHub Token'
|
||||||
required: true
|
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:
|
args:
|
||||||
description: 'Renovate Args'
|
description: 'Renovate Args'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
save-cache:
|
|
||||||
description: 'Save cache'
|
|
||||||
required: false
|
|
||||||
default: 'false'
|
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
- name: Cache Renovate
|
||||||
|
uses: https://code.forgejo.org/actions/cache@v4.2.0
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
.tmp/cache/renovate/repository
|
.tmp/cache/renovate/repository
|
||||||
key: renovate-cache-${{ inputs.endpoint }}-${{ github.run_id }}
|
key: renovate-${{ inputs.endpoint }}-${{ github.run_id }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
renovate-cache-${{ inputs.endpoint }}-
|
renovate-${{ inputs.endpoint }}-
|
||||||
|
compression: true
|
||||||
|
timeout: 900000
|
||||||
|
retry: 5
|
||||||
|
retry-wait: 5000
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
renovate ${{ inputs.args }}
|
renovate ${{ inputs.args }}
|
||||||
|
@ -44,17 +54,13 @@ runs:
|
||||||
RENOVATE_PLATFORM: gitea
|
RENOVATE_PLATFORM: gitea
|
||||||
RENOVATE_REPOSITORY_CACHE: 'enabled'
|
RENOVATE_REPOSITORY_CACHE: 'enabled'
|
||||||
RENOVATE_TOKEN: ${{ inputs.token }}
|
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_NAME: 'Renovate Bot'
|
||||||
GIT_AUTHOR_EMAIL: 'smeagol@hsn.dev'
|
GIT_AUTHOR_EMAIL: 'smeagol@hsn.dev'
|
||||||
GIT_COMMITTER_NAME: 'Renovate Bot'
|
GIT_COMMITTER_NAME: 'Renovate Bot'
|
||||||
GIT_COMMITTER_EMAIL: 'smeagol@hsn.dev'
|
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 }}
|
|
||||||
|
|
|
@ -13,8 +13,7 @@ on:
|
||||||
type: boolean
|
type: boolean
|
||||||
env:
|
env:
|
||||||
RENOVATE_DRY_RUN: "${{ inputs.dryRun == true }}"
|
RENOVATE_DRY_RUN: "${{ inputs.dryRun == true }}"
|
||||||
DOCKER_USERNAME: "${{ secrets.DOCKER_USERNAME }}"
|
|
||||||
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
|
|
||||||
jobs:
|
jobs:
|
||||||
renovate:
|
renovate:
|
||||||
name: Renovate
|
name: Renovate
|
||||||
|
@ -26,26 +25,13 @@ jobs:
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
show-progress: false
|
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
|
- name: Renovate
|
||||||
uses: ./.forgejo/actions/renovate
|
uses: ./.forgejo/actions/renovate
|
||||||
with:
|
with:
|
||||||
endpoint: https://git.hsn.dev/api/v1/
|
endpoint: https://git.hsn.dev/api/v1/
|
||||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||||
github-token: ${{ secrets.GH_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
|
args: --platform gitea --autodiscover
|
||||||
save-cache: true
|
|
||||||
env:
|
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
Loading…
Reference in a new issue