From 7e8373d9b358c8ad977f9ec2f5252c2a1acd8de1 Mon Sep 17 00:00:00 2001 From: Gerard Braad Date: Tue, 7 Jan 2025 02:49:39 +0000 Subject: [PATCH] Refactor optional images --- .github/workflows/build-container-coder.yml | 24 ++++++++++++++ .../workflows/build-container-rdesktop.yml | 24 ++++++++++++++ .github/workflows/build-container-toolbox.yml | 24 ++++++++++++++ .github/workflows/build-containers.yml | 4 --- .github/workflows/tailscale-coder.yml | 32 +++++++++++++++++++ 5 files changed, 104 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build-container-coder.yml create mode 100644 .github/workflows/build-container-rdesktop.yml create mode 100644 .github/workflows/build-container-toolbox.yml create mode 100644 .github/workflows/tailscale-coder.yml diff --git a/.github/workflows/build-container-coder.yml b/.github/workflows/build-container-coder.yml new file mode 100644 index 0000000..9909621 --- /dev/null +++ b/.github/workflows/build-container-coder.yml @@ -0,0 +1,24 @@ +name: build container - coder +run-name: building container - coder +on: + schedule: + - cron: "0 0 1 * *" + workflow_dispatch: +jobs: + build: + permissions: + contents: read + packages: write + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-24.04 + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Run podman build - coder + run: podman build -t ghcr.io/gbraad-devenv/fedora/coder:41 -f containers/Containerfile-coder . + - name: Push image to ghcr.io - coder + run: podman push --creds=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/gbraad-devenv/fedora/coder:41 diff --git a/.github/workflows/build-container-rdesktop.yml b/.github/workflows/build-container-rdesktop.yml new file mode 100644 index 0000000..7274aeb --- /dev/null +++ b/.github/workflows/build-container-rdesktop.yml @@ -0,0 +1,24 @@ +name: build container - rdeskop +run-name: building container - rdesktop +on: + schedule: + - cron: "0 0 1 * *" + workflow_dispatch: +jobs: + build: + permissions: + contents: read + packages: write + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-24.04 + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Run podman build - rdesktop + run: podman build -t ghcr.io/gbraad-devenv/fedora/rdesktop:41 -f containers/Containerfile-rdesktop . + - name: Push image to ghcr.io - rdesktop + run: podman push --creds=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/gbraad-devenv/fedora/rdesktop:41 diff --git a/.github/workflows/build-container-toolbox.yml b/.github/workflows/build-container-toolbox.yml new file mode 100644 index 0000000..c48a98f --- /dev/null +++ b/.github/workflows/build-container-toolbox.yml @@ -0,0 +1,24 @@ +name: build container - toolbox +run-name: building container - toolbox +on: + schedule: + - cron: "0 0 1 * *" + workflow_dispatch: +jobs: + build: + permissions: + contents: read + packages: write + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-24.04 + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Run podman build - toolbox + run: podman build -t ghcr.io/gbraad-devenv/fedora/toolbox:41 -f containers/Containerfile-toolbox . + - name: Push image to ghcr.io - toolbox + run: podman push --creds=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/gbraad-devenv/fedora/toolbox:41 diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index fe6d942..972685f 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -26,8 +26,6 @@ jobs: run: podman build -t ghcr.io/gbraad-devenv/fedora/systemd:41 -f containers/Containerfile-systemd . - name: Run podman build - rdesktop run: podman build -t ghcr.io/gbraad-devenv/fedora/rdesktop:41 -f containers/Containerfile-rdesktop . - - name: Run podman build - coder - run: podman build -t ghcr.io/gbraad-devenv/fedora/coder:41 -f containers/Containerfile-coder . - name: Push image to ghcr.io - base run: podman push --creds=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/gbraad-devenv/fedora/base:41 - name: Push image to ghcr.io - dotfiles @@ -36,5 +34,3 @@ jobs: run: podman push --creds=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/gbraad-devenv/fedora/systemd:41 - name: Push image to ghcr.io - rdesktop run: podman push --creds=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/gbraad-devenv/fedora/rdesktop:41 - - name: Push image to ghcr.io - coder - run: podman push --creds=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/gbraad-devenv/fedora/coder:41 diff --git a/.github/workflows/tailscale-coder.yml b/.github/workflows/tailscale-coder.yml new file mode 100644 index 0000000..d4d5658 --- /dev/null +++ b/.github/workflows/tailscale-coder.yml @@ -0,0 +1,32 @@ +name: tailscale-coder +on: + workflow_dispatch: + +jobs: + coder-test: + runs-on: ubuntu-24.04 + + steps: + - name: Run system container with `podman` + run: | + podman run -d --name coder ghcr.io/gbraad-devenv/fedora/coder:41 + - name: Tailscale setup (root) + run: | + until podman exec coder tailscale up --auth-key ${TAILSCALE_AUTHKEY} + do + sleep 0.1 + done + podman exec coder tailscale set --ssh + podman exec coder tailscale set --hostname github-${HOSTNAME} + env: + TAILSCALE_AUTHKEY: ${{ secrets.TAILSCALE_AUTHKEY}} + - name: Hang around + run: | + until podman exec coder systemctl is-active code-server@gbraad + do + sleep 1 + done + IP=`podman exec coder tailscale ip -4` + echo "Open in your web browser: https://${IP}:8080" + podman exec coder cat ~gbraad/.config/code-server/config.yaml + sleep infinity