Skip to content

Commit

Permalink
chore: PR preview fixes (#1021)
Browse files Browse the repository at this point in the history
* chore: set log level=debug

* chore: try removing healthcheck

* chore: add healthcheck back

* chore: attach false maybe

* chore: really not sure

* chore: try removing minio-init

* chore: empty test commit
  • Loading branch information
3mcd authored Mar 4, 2025
1 parent 285a3f3 commit b805225
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 26 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

deploy-preview:
permissions: write-all
permissions:
contents: read
deployments: write
pull-requests: write
statuses: write
runs-on: ubuntu-latest
timeout-minutes: 30
needs:
Expand Down Expand Up @@ -71,13 +75,13 @@ jobs:
with:
label: preview
admins: 3mcd
cidrs: "0.0.0.0/0"
compose_files: ./self-host/docker-compose.yml,docker-compose.preview.yml
default_port: 443
instance_type: small
ports: 443,9001
ports: 80,443,9001
registries: docker://AWS:${{steps.ecrtoken.outputs.value}}@246372085946.dkr.ecr.us-east-1.amazonaws.com
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ env.AWS_REGION }}
PULLPREVIEW_LOGGER_LEVEL: DEBUG
13 changes: 7 additions & 6 deletions docker-compose.preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ services:
ASSETS_UPLOAD_KEY: preview-different
ASSETS_UPLOAD_SECRET_KEY: preview-different123
ASSETS_STORAGE_ENDPOINT: https://${PULLPREVIEW_PUBLIC_DNS}/assets
minio-init:
environment:
MINIO_ROOT_USER: preview
MINIO_ROOT_PASSWORD: preview123
ASSETS_UPLOAD_KEY: preview-different
ASSETS_UPLOAD_SECRET_KEY: preview-different123
# minio-init:
# restart: on-failure
# environment:
# MINIO_ROOT_USER: preview
# MINIO_ROOT_PASSWORD: preview123
# ASSETS_UPLOAD_KEY: preview-different
# ASSETS_UPLOAD_SECRET_KEY: preview-different123
minio:
environment:
MINIO_ROOT_USER: preview
Expand Down
34 changes: 17 additions & 17 deletions self-host/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,23 @@ services:
- app-network

# initialize minio
minio-init:
depends_on:
minio:
condition: service_healthy
image: minio/mc:latest
env_file: .env
entrypoint: >
/bin/sh -c '
/usr/bin/mc config host add myminio http://minio:9000 "$${MINIO_ROOT_USER}" "$${MINIO_ROOT_PASSWORD}";
/usr/bin/mc mb --ignore-existing myminio/"$${ASSETS_BUCKET_NAME}";
/usr/bin/mc anonymous set download myminio/"$${ASSETS_BUCKET_NAME}";
/usr/bin/mc admin user add myminio "$${ASSETS_UPLOAD_KEY}" "$${ASSETS_UPLOAD_SECRET_KEY}";
/usr/bin/mc admin policy attach myminio readwrite --user "$${ASSETS_UPLOAD_KEY}";
exit 0;
'
networks:
- app-network
# minio-init:
# depends_on:
# minio:
# condition: service_healthy
# image: minio/mc:latest
# env_file: .env
# entrypoint: >
# /bin/sh -c '
# /usr/bin/mc config host add myminio http://minio:9000 "$${MINIO_ROOT_USER}" "$${MINIO_ROOT_PASSWORD}";
# /usr/bin/mc mb --ignore-existing myminio/"$${ASSETS_BUCKET_NAME}";
# /usr/bin/mc anonymous set download myminio/"$${ASSETS_BUCKET_NAME}";
# /usr/bin/mc admin user add myminio "$${ASSETS_UPLOAD_KEY}" "$${ASSETS_UPLOAD_SECRET_KEY}";
# /usr/bin/mc admin policy attach myminio readwrite --user "$${ASSETS_UPLOAD_KEY}";
# exit 0;
# '
# networks:
# - app-network

volumes:
caddy-data:
Expand Down

0 comments on commit b805225

Please sign in to comment.