From 87b1bc12c27f2375b483857ea9b9099d5fd25ace Mon Sep 17 00:00:00 2001 From: SorsOps <80043879+sorsOps@users.noreply.github.com> Date: Thu, 20 Jun 2024 00:40:10 +0200 Subject: [PATCH] Change asset storage --- .gimlet/penpot-pr.yaml | 19 ++++++++++++++++--- .gimlet/penpot-prod.yaml | 13 ++++++++++--- .github/workflows/cleanup.yaml | 30 +++++++++++++++++++++++++++++- 3 files changed, 55 insertions(+), 7 deletions(-) diff --git a/.gimlet/penpot-pr.yaml b/.gimlet/penpot-pr.yaml index 165808cd2..2f9d206d8 100644 --- a/.gimlet/penpot-pr.yaml +++ b/.gimlet/penpot-pr.yaml @@ -18,9 +18,6 @@ values: redisEnabled: false imagePullSecrets: - name: ghcr-login-secret - persistence: - enabled: true - storageClass: standard-rwx postgresql: # use the existing db enabled: false @@ -30,6 +27,22 @@ values: secret: db-penpot-secrets superUser: db-penpot-superuser-secret config: + assets: + storageBackend: assets-s3 + s3: + bucket: assets + endpointURI: http://minio.penpot.svc.cluster.local:80 + existingSecret: + penpot-assets-user-0 + secretKeys: + accessKeyIDKey: CONSOLE_ACCESS_KEY + secretAccessKey: CONSOLE_SECRET_KEY + + # - AWS_ACCESS_KEY_ID= + # - AWS_SECRET_ACCESS_KEY= + # - PENPOT_ASSETS_STORAGE_BACKEND=assets-s3 + # - PENPOT_STORAGE_ASSETS_S3_ENDPOINT=http://penpot-minio:9000 + # - PENPOT_STORAGE_ASSETS_S3_BUCKET= smtp: enabled: true host: mailslurper diff --git a/.gimlet/penpot-prod.yaml b/.gimlet/penpot-prod.yaml index 4fce53fe9..b9b22ffc1 100644 --- a/.gimlet/penpot-prod.yaml +++ b/.gimlet/penpot-prod.yaml @@ -14,9 +14,6 @@ values: redisEnabled: true imagePullSecrets: - name: ghcr-login-secret - persistence: - enabled: true - storageClass: standard-rwx postgresql: enabled: true owner: penpot @@ -25,6 +22,16 @@ values: secret: db-penpot-secrets superUser: db-penpot-superuser-secret config: + assets: + storageBackend: assets-s3 + s3: + bucket: assets + endpointURI: http://minio.penpot.svc.cluster.local:80 + existingSecret: + penpot-assets-user-0 + secretKeys: + accessKeyIDKey: CONSOLE_ACCESS_KEY + secretAccessKey: CONSOLE_SECRET_KEY smtp: enabled: true host: mailslurper diff --git a/.github/workflows/cleanup.yaml b/.github/workflows/cleanup.yaml index 77facd090..f537e69dd 100644 --- a/.github/workflows/cleanup.yaml +++ b/.github/workflows/cleanup.yaml @@ -10,8 +10,36 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Determine the branch name + id: determine_branch + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + echo "branch_name=${{ github.head_ref }}" >> $GITHUB_ENV + else + echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + fi + - name: Replace / with - in branch name + id: replace_slash + run: | + SANITIZED_BRANCH_NAME=$(echo "${{ env.branch_name }}" | tr '/' '-') + echo "sanitized_branch_name=${SANITIZED_BRANCH_NAME}" >> $GITHUB_ENV + - name: 🍍 Deploy with Gimlet uses: gimlet-io/gimlet-artifact-shipper-action@v0.8.3 env: GIMLET_SERVER: ${{ secrets.GIMLET_SERVER }} - GIMLET_TOKEN: ${{ secrets.GIMLET_TOKEN }} \ No newline at end of file + GIMLET_TOKEN: ${{ secrets.GIMLET_TOKEN }} + - name: Delete image + uses: bots-house/ghcr-delete-image-action@v1.1.0 + with: + owner: tokens-studio + name: tokens-studio-for-penpot + token: ${{ secrets.PAT_TOKEN }} + tag: pr-frontend-${{ env.sanitized_branch_name }} + - name: Delete image + uses: bots-house/ghcr-delete-image-action@v1.1.0 + with: + owner: tokens-studio + name: tokens-studio-for-penpot + token: ${{ secrets.PAT_TOKEN }} + tag: pr-backend-${{ env.sanitized_branch_name }} \ No newline at end of file