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.
This commit is contained in:
Anders Rytter Hansen 2023-11-05 17:02:37 +01:00
commit e90305db58
4 changed files with 18 additions and 42 deletions

View file

@ -61,6 +61,10 @@ jobs:
with: with:
cosign-release: 'v2.1.1' 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 # Login against a Docker registry except on PR
# https://github.com/docker/login-action # https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }} - name: Log into registry ${{ env.REGISTRY }}
@ -79,44 +83,18 @@ jobs:
with: with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# Build image using Buildah action # https://github.com/docker/build-push-action
- name: Build Image - name: Build and push Docker image
id: build_image id: build-and-push
uses: redhat-actions/buildah-build@v2 uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with: with:
containerfiles: | context: .
./Dockerfile push: ${{ github.event_name != 'pull_request' }}
image: ${{ env.IMAGE_NAME }} tags: ${{ steps.meta.outputs.tags }}, ${{ steps.meta.outputs.tags }}-38, ${{ steps.meta.outputs.tags }}-38.${{ steps.date.outputs.date }}
tags: ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-38 ${{ steps.meta.outputs.tags }}-38.${{ steps.date.outputs.date }} # labels: ${{ steps.meta.outputs.labels }}
oci: false cache-from: type=gha
layers: false cache-to: type=gha,mode=max
# 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
# Sign the resulting Docker image digest except on PRs. # Sign the resulting Docker image digest except on PRs.
@ -129,7 +107,7 @@ jobs:
env: env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }} 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 # This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance. # against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

View file

@ -1,3 +0,0 @@
#!/bin/sh
distrobox-export --app tradingview --extra-flags "--enable-features=WaylandWindowDecorations --ozone-platform=wayland"

View file

@ -13,7 +13,6 @@ home="~/containers/general"
image=ghcr.io/andersrh/containers/cachyos/tradingview:main image=ghcr.io/andersrh/containers/cachyos/tradingview:main
#additional_packages=" " #additional_packages=" "
#export="app tradingview" #export="app tradingview"
init_hooks="create_shortcut"
init=false init=false
nvidia=true nvidia=true
pull=true pull=true

View file

@ -4,3 +4,5 @@ podman rm -f general-cachyos
podman rm -f tradingview podman rm -f tradingview
distrobox assemble create --file /etc/distrobox.ini distrobox assemble create --file /etc/distrobox.ini
distrobox enter tradingview -- distrobox-export --app tradingview --extra-flags "--enable-features=WaylandWindowDecorations --ozone-platform=wayland"