fingers crossed
This commit is contained in:
parent
22847804ba
commit
8b4611b04b
1 changed files with 31 additions and 28 deletions
|
|
@ -23,7 +23,10 @@ jobs:
|
|||
# They are defined in group_vars/all.yml, but can be overridden from here if needed.
|
||||
# TEMPLATE_VMID: 9001 # Removed from direct env for explicit passing to Ansible
|
||||
# LATEST_TEMPLATE_VMID: 9000 # Removed from direct env for explicit passing to Ansible
|
||||
|
||||
outputs:
|
||||
image-name: ${{ steps.build_image.outputs.image_name_from_build }}
|
||||
flake-metadata: ${{ steps.meta.outputs.metadata}}
|
||||
artifacts-url: ${{ steps.artifact.outputs.artifact-url}}
|
||||
steps:
|
||||
# Use nix-env for setup (as you prefer and it works well for ephemeral environments)
|
||||
- name: Install dependencies via nix-env
|
||||
|
|
@ -76,11 +79,13 @@ jobs:
|
|||
|
||||
# Capture the actual image path from the result symlink for Ansible
|
||||
IMAGE_PATH=$(find result/ -name "*.vma.zst" | head -n 1)
|
||||
IMAGE_NAME=$(basename "$IMAGE_PATH")
|
||||
if [ -z "$IMAGE_PATH" ]; then
|
||||
echo "Error: No .vma.zst image found after build."
|
||||
exit 1
|
||||
fi
|
||||
echo "image_path_from_build=${IMAGE_PATH}" >> "$GITHUB_OUTPUT"
|
||||
echo "image_name_from_build=${IMAGE_NAME}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Run Proxmox Image Deployment
|
||||
run: |
|
||||
|
|
@ -103,12 +108,27 @@ jobs:
|
|||
proxmox_user={{ env.PROXMOX_USER }}
|
||||
remote_image_path_ci={{ steps.build_image.outputs.image_path_from_build }}
|
||||
|
||||
- name: Extract image filename
|
||||
id: image
|
||||
run: |
|
||||
IMAGE=$(basename ${{ steps.build_image.outputs.image_path_from_build }}/*.vma.zst)
|
||||
echo "Image filename: $IMAGE"
|
||||
echo "filename=$IMAGE" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Extract flake metadata
|
||||
id: meta
|
||||
run: |
|
||||
nix flake metadata --json > metadata.json
|
||||
META=$(cat metadata.json | jq -r '.locks.nodes.root.inputs | to_entries[] | "* \(.key): \(.value.locked.url) @ \(.value.locked.rev)"' | sed ':a;N;$!ba;s/\n/\\n/g')
|
||||
echo "metadata=$META" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload Artifact
|
||||
id: artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
if: ${{ steps.build_image.outputs.image_path_from_build }}
|
||||
with:
|
||||
name: nixos-base-image
|
||||
path: result
|
||||
name: build-artifact
|
||||
path: .
|
||||
|
||||
release:
|
||||
name: Release Image
|
||||
|
|
@ -116,12 +136,6 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
if: success()
|
||||
steps:
|
||||
- name: Download Artifact
|
||||
id: artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: nixos-base-image
|
||||
|
||||
- name: Set version
|
||||
id: version
|
||||
run: |
|
||||
|
|
@ -135,21 +149,6 @@ jobs:
|
|||
echo "Version: $TAG_NAME"
|
||||
echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Parse image filename
|
||||
id: image
|
||||
run: |
|
||||
IMAGE=$(basename ${{ steps.artifact.outputs.download-path }}/*.vma.zst)
|
||||
echo "Image filename: $IMAGE"
|
||||
echo "filename=$IMAGE" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# - name: Extract flake metadata
|
||||
# id: meta
|
||||
# run: |
|
||||
# META=$(nix flake metadata --json | jq -r '.locks.nodes.root.inputs | to_entries[] | "* \(.key): \(.value.locked.url) @ \(.value.locked.rev)"')
|
||||
# echo "metadata<<EOF" >> $GITHUB_OUTPUT
|
||||
# echo "$META" >> $GITHUB_OUTPUT
|
||||
# echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create Forgejo Release
|
||||
uses: https://code.forgejo.org/sheik/forgejo-release@v2.6.0
|
||||
with:
|
||||
|
|
@ -161,12 +160,16 @@ jobs:
|
|||
✅ **Base NixOS image uploaded**
|
||||
|
||||
**🧱 Image File:**
|
||||
`/var/lib/vz/dump/${{ steps.image.outputs.filename }}`
|
||||
`/var/lib/vz/dump/${{ needs.build.outputs.image-name }}`
|
||||
|
||||
**🔗 Build Logs:**
|
||||
[View Actions Run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }})
|
||||
**🔗 Build Results:**
|
||||
[View Build Logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }})
|
||||
[Download Build Artifact](${{ needs.build.outputs.artifacts-url }})
|
||||
|
||||
**🔐 Flake Revision:**
|
||||
`${{ github.sha }}`
|
||||
|
||||
release-dir: "${{ steps.artifact.outputs.download-path }}/nix-support"
|
||||
**📦 Flake Inputs:**
|
||||
${{ needs.build.outputs.flake-metadata }}
|
||||
|
||||
release-dir: "."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue