From 08e68979fdebf375218e9f82432273b38738af92 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Wed, 27 Sep 2023 23:15:11 +0200 Subject: [PATCH] Add a script for deploying website. --- turnup.yaml | 3 +++ website.yaml | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 website.yaml diff --git a/turnup.yaml b/turnup.yaml index c6ef9ea..f7b38a9 100644 --- a/turnup.yaml +++ b/turnup.yaml @@ -30,3 +30,6 @@ - name: Deploy cv import_playbook: cv.yaml + +- name: Deploy website + import_playbook: website.yaml diff --git a/website.yaml b/website.yaml new file mode 100644 index 0000000..2aa53e9 --- /dev/null +++ b/website.yaml @@ -0,0 +1,19 @@ +# Copyright (c) 2023 Jakub Czajka +# License: GPL-3.0 or later. + +- hosts: servers + vars: + repos: + - /srv/git/website.git + dest: "/srv/prod/www" + tasks: + - name: Ensure destination directory exists + file: + path: "{{ dest }}" + state: directory + become: true + - name: Checkout files to the destination directory + command: | + git --work-tree={{ dest }} --git-dir={{ item }} checkout main --force + become: yes + with_items: "{{ repos }}" -- 2.39.5