Skip to content

Commit

Permalink
Attemp to use podman commit in action
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Mar 8, 2024
1 parent 8f7b063 commit 82f682c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,30 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 #v2.13
with:
image: home
image: systemd
tags: latest ${{ github.sha }} ${{ needs.get-meta.outputs.started_at }}
containerfiles: |
containers/Containerfile
oci: true
- name: Logging podman version
run: podman version
- name: Run and commit Nix operations by the user while running the systemd
run: |
podman run --rm systemd &
container_name="$(podman ps --sort=created --format {{.Names}} | tail -1)"
podman exec --user=user -it "$container_name" /provisioner/needs_systemd.bash
podman commit "$container_name" ran-nix-commands-by-user
podman kill "$container_name"
- name: Finalize the image
id: build-image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 #v2.13
with:
image: home
base-image: ran-nix-commands-by-user
tags: latest ${{ github.sha }} ${{ needs.get-meta.outputs.started_at }}
oci: true
- name: Push To ghcr.io
id: push-to-ghcr
if: ${{ github.event_name != 'pull_request' }}
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ echo $CR_PAT | ppodman login ghcr.io -u YOUR_USERNAME --password-stdin
podman run --rm ghcr.io/kachick/home:latest &
container_name="$(podman ps --sort=created --format {{.Names}} | tail -1)"
podman exec --user=user -it "$container_name" /provisioner/needs_systemd.bash
podman exec --user=user -it "$container_name" rm -rf '/provisioner/dotfiles/'
podman exec --user=root -it "$container_name" chsh user -s "$HOME/.nix-profile/bin/zsh"
podman commit "$container_name" localhost/kachick/home:latest
podman exec --user=user -it "$container_name" /home/user/.nix-profile/bin/zsh
podman kill "$container_name"
Expand Down

0 comments on commit 82f682c

Please sign in to comment.