mirror of
https://github.com/2martens/tsw-timetable.git
synced 2026-10-17 07:57:55 +02:00
35 lines
1.3 KiB
YAML
35 lines
1.3 KiB
YAML
name: Deploy
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
image_version:
|
|
description: Tag of the application to deploy
|
|
default: latest
|
|
required: false
|
|
target:
|
|
description: Target overlay of deployment
|
|
default: test
|
|
required: true
|
|
permissions:
|
|
contents: write
|
|
jobs:
|
|
deploy:
|
|
name: Deploy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
repository: 2martens/cloud-configuration
|
|
- name: Update image version
|
|
run: |
|
|
mkdir $HOME/bin
|
|
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64 -O $HOME/bin/yq && chmod +x $HOME/bin/yq
|
|
sed -i -r "s/(tag:).*/\1\ \"${{ inputs.image_version }}\"/" argocd/timetable/${{ inputs.target }}/overwrite_values.yaml
|
|
cd argocd/timetable/${{ inputs.target }} && $HOME/bin/yq '. *= load("overwrite_values.yaml")' default_values.yaml > values.yaml
|
|
- name: Save modified variable file
|
|
run: |
|
|
git add argocd/timetable/${{ inputs.target }}/*
|
|
git config --global user.name 'Your Name'
|
|
git config --global user.email 'your-username@users.noreply.github.com'
|
|
git diff-index --quiet HEAD || git commit -m "chore: Change timetable_image_version to ${{ inputs.image_version }}"
|
|
git push |