diff --git a/build.yaml b/build.yaml index bb2ad70..b76339d 100644 --- a/build.yaml +++ b/build.yaml @@ -17,9 +17,31 @@ ansible.builtin.debug: var: force_rm + - name: Get the version from git + command: git describe --dirty --tags + register: version + args: + chdir: "{{ playbook_dir }}" + + - name: Build the base CI image + containers.podman.podman_image: + name: treetrail-backend-ci + tag: "{{ version }}" + state: build + path: "{{ playbook_dir }}" + build: + format: oci + force_rm: "{{ force_rm }}" + cache: "{{ cache }}" + file: Containerfile.ci + push: true + push_args: + dest: "{{ repository }}/{{ organisation }}/treetrail-backend-ci" + - name: Build the base image, only with python dependencies containers.podman.podman_image: name: treetrail-backend-deps + tag: "{{ version }}" state: build path: "{{ playbook_dir }}" build: @@ -29,17 +51,12 @@ file: Containerfile.deps push: true push_args: - dest: "{{ repository }}/{{ organisation }}/treetrail-backend-deps" - - - name: Get the version from git - command: git describe --dirty --tags - register: version - args: - chdir: "{{ playbook_dir }}" + dest: "{{ repository }}/{{ organisation }}" - name: Build the backend container image containers.podman.podman_image: - name: "treetrail-backend:{{ version.stdout }}" + name: treetrail-backend + tag: "{{ version.stdout }}" state: build force: true path: "{{ playbook_dir }}" @@ -51,4 +68,4 @@ extra_args: "--build-arg APP_VERSION={{ version.stdout }}" push: true push_args: - dest: "{{ repository }}/{{ organisation }}/treetrail-backend:{{ version.stdout }}" + dest: "{{ repository }}/{{ organisation }}"