Explorar el Código

Move docs exporting to a separate script in the hopes it'll actually work there.

Dan Helfman hace 7 meses
padre
commit
9b623a8a8e
Se han modificado 2 ficheros con 12 adiciones y 7 borrados
  1. 1 7
      .gitea/workflows/build.yaml
  2. 11 0
      scripts/export-docs-from-image

+ 1 - 7
.gitea/workflows/build.yaml

@@ -26,11 +26,5 @@ jobs:
           PASSWORD: "${{ secrets.REGISTRY_PASSWORD }}"
       - run: podman build --tag "$IMAGE_NAME" --file docs/Dockerfile --storage-opt "overlay.mount_program=/usr/bin/fuse-overlayfs" .
       - run: podman push "$IMAGE_NAME"
-      - run: mkdir borgmatic-docs
-      - run: docs_container_id=$(podman create "$IMAGE_NAME")
-      - run: podman cp $docs_container_id:/usr/share/nginx/html - > borgmatic-docs-dump.tar
-      - run: tar xf borgmatic-docs-dump.tar
-      - run: mv html borgmatic-docs
-      - run: tar cfz borgmatic-docs.tar.gz borgmatic-docs
-      - run: podman rm --volumes $docs_container_id
+      - run: scripts/export-docs-from-image
       - run: curl --user "${{ secrets.REGISTRY_USERNAME }}:${{ secrets.REGISTRY_PASSWORD }}" --upload-file borgmatic-docs.tar.gz https://projects.torsion.org/api/packages/borgmatic-collective/generic/borgmatic-docs/$(head --lines=1 NEWS)/borgmatic-docs.tar.gz

+ 11 - 0
scripts/export-docs-from-image

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+docs_container_id=$(podman create "$IMAGE_NAME")
+podman cp $docs_container_id:/usr/share/nginx/html - > borgmatic-docs-dump.tar
+tar xf borgmatic-docs-dump.tar
+rm borgmatic-docs-dump.tar
+mv html borgmatic-docs
+tar cfz borgmatic-docs.tar.gz borgmatic-docs
+podman rm --volumes $docs_container_id