From e90305db5898380bf81821531140cc4ede31cd19 Mon Sep 17 00:00:00 2001 From: Anders Rytter Hansen Date: Sun, 5 Nov 2023 17:02:37 +0100 Subject: [PATCH] fix tradingview and docker for OS image manually create tradingview shortcut in script and change back to docker from buildah for OS image in order to use caching. --- .github/workflows/os.yml | 54 ++++++------------- .../cachyos/tradingview/bin/create_shortcut | 3 -- etc/distrobox.ini | 1 - usr/local/bin/distrobox-update | 2 + 4 files changed, 18 insertions(+), 42 deletions(-) delete mode 100755 containers/cachyos/tradingview/bin/create_shortcut diff --git a/.github/workflows/os.yml b/.github/workflows/os.yml index 147bbbf..f7ae8ce 100644 --- a/.github/workflows/os.yml +++ b/.github/workflows/os.yml @@ -61,6 +61,10 @@ jobs: with: cosign-release: 'v2.1.1' + # Workaround: https://github.com/docker/build-push-action/issues/461 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf + # Login against a Docker registry except on PR # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} @@ -79,44 +83,18 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - # Build image using Buildah action - - name: Build Image - id: build_image - uses: redhat-actions/buildah-build@v2 + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a with: - containerfiles: | - ./Dockerfile - image: ${{ env.IMAGE_NAME }} - tags: ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-38 ${{ steps.meta.outputs.tags }}-38.${{ steps.date.outputs.date }} - oci: false - layers: false - - # Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR. - # https://github.com/macbre/push-to-ghcr/issues/12 - - name: Lowercase Registry - id: registry_case - uses: ASzc/change-string-case-action@v5 - with: - string: ${{ env.IMAGE_REGISTRY }} - - # Push the image to GHCR (Image Registry) - - name: Push To GHCR - uses: redhat-actions/push-to-registry@v2 - id: push - if: github.event_name != 'pull_request' - env: - REGISTRY_USER: ${{ github.actor }} - REGISTRY_PASSWORD: ${{ github.token }} - with: - image: ${{ steps.build_image.outputs.image }} - tags: ${{ steps.build_image.outputs.tags }} - registry: ${{ steps.registry_case.outputs.lowercase }} - username: ${{ env.REGISTRY_USER }} - password: ${{ env.REGISTRY_PASSWORD }} - extra-args: | - --disable-content-trust - + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }}, ${{ steps.meta.outputs.tags }}-38, ${{ steps.meta.outputs.tags }}-38.${{ steps.date.outputs.date }} + # labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max # Sign the resulting Docker image digest except on PRs. @@ -129,7 +107,7 @@ jobs: env: # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable TAGS: ${{ steps.meta.outputs.tags }} - DIGEST: ${{ steps.push.outputs.digest }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} # This step uses the identity token to provision an ephemeral certificate # against the sigstore community Fulcio instance. run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} diff --git a/containers/cachyos/tradingview/bin/create_shortcut b/containers/cachyos/tradingview/bin/create_shortcut deleted file mode 100755 index 977f28e..0000000 --- a/containers/cachyos/tradingview/bin/create_shortcut +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -distrobox-export --app tradingview --extra-flags "--enable-features=WaylandWindowDecorations --ozone-platform=wayland" diff --git a/etc/distrobox.ini b/etc/distrobox.ini index 0ca6e0d..cc6ab89 100644 --- a/etc/distrobox.ini +++ b/etc/distrobox.ini @@ -13,7 +13,6 @@ home="~/containers/general" image=ghcr.io/andersrh/containers/cachyos/tradingview:main #additional_packages=" " #export="app tradingview" -init_hooks="create_shortcut" init=false nvidia=true pull=true diff --git a/usr/local/bin/distrobox-update b/usr/local/bin/distrobox-update index 0ecf92b..6e8339d 100755 --- a/usr/local/bin/distrobox-update +++ b/usr/local/bin/distrobox-update @@ -4,3 +4,5 @@ podman rm -f general-cachyos podman rm -f tradingview distrobox assemble create --file /etc/distrobox.ini + +distrobox enter tradingview -- distrobox-export --app tradingview --extra-flags "--enable-features=WaylandWindowDecorations --ozone-platform=wayland"