From: Jakub Czajka Date: Wed, 27 Sep 2023 21:15:11 +0000 (+0200) Subject: Add a script for deploying website. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=08e68979fdebf375218e9f82432273b38738af92;p=turnup.git Add a script for deploying website. --- 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 }}"