From 609002bccd4ca832db5fa0e69232d825a69e83f8 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Tue, 9 Jan 2024 18:59:29 +0100 Subject: [PATCH] chore: Add workflow to deploy application --- .github/workflows/deploy.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..9052331 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,35 @@ +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 \ No newline at end of file