43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
name: Update Infra Version
|
|
description: Updates the service tag in the stat-tackler-infra releases/versions.yaml
|
|
inputs:
|
|
token:
|
|
description: "Gitea token with read/write access to the infra repo"
|
|
required: true
|
|
service:
|
|
description: "Service name key in versions.yaml (e.g. stat-tackler-api)"
|
|
required: true
|
|
tag:
|
|
description: "The image tag to set for the service"
|
|
required: true
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Clone infra repo
|
|
shell: sh
|
|
run: |
|
|
git clone https://gitea-actions:${{ inputs.token }}@gitea.pixelparasol.com/stat-tackler/stat-tackler-infra.git infra
|
|
|
|
- name: Install yq
|
|
shell: sh
|
|
run: |
|
|
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
|
|
chmod +x /usr/local/bin/yq
|
|
|
|
- name: Update tag in versions.yaml
|
|
shell: sh
|
|
run: |
|
|
cd infra
|
|
yq e ".services.${{ inputs.service }}.tag = \"${{ inputs.tag }}\"" -i releases/versions.yaml
|
|
|
|
- name: Commit and push
|
|
shell: sh
|
|
run: |
|
|
cd infra
|
|
git config user.email "gitea-actions@gitea.pixelparasol.com"
|
|
git config user.name "Gitea Actions"
|
|
git add releases/versions.yaml
|
|
git commit -m "chore: update ${{ inputs.service }} to ${{ inputs.tag }}"
|
|
git push
|