Skip to content

Commit

Permalink
'bsky' (appview) dev helpers (#888)
Browse files Browse the repository at this point in the history
* remove commited .env files; exclude in gitignore

* bsky: distinct postgresql database in dev mode

* github CI: build and upload 'bsky' container to GHCR

This isn't how we deploy, but is useful for public access and things
like integration tests.

* Makefile: run-dev-appview
  • Loading branch information
bnewbold authored Apr 24, 2023
1 parent 02dcf7d commit af9f11f
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 5 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build-and-push-bsky-ghcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build-and-push-bsky-ghcr
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}

# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:
bsky-container-ghcr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v1

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,enable=true,priority=100,prefix=bsky:,suffix=,format=long
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
file: ./packages/bsky/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ test.sqlite
.DS_Store
*.log
tsconfig.build.tsbuildinfo
.dev.env
.*.env
.env
\#*\#
*~
*.swp
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ run-dev-pds: ## Run PDS locally
if [ ! -f "packages/pds/.dev.env" ]; then cp packages/pds/example.dev.env packages/pds/.dev.env; fi
cd packages/pds; ENV=dev yarn run start | yarn exec pino-pretty

.PHONY: run-dev-bsky
run-dev-bsky: ## Run appview ('bsky') locally
if [ ! -f "packages/bsky/.dev.env" ]; then cp packages/bsky/example.dev.env packages/bsky/.dev.env; fi
cd packages/bsky; ENV=dev yarn run start | yarn exec pino-pretty

.PHONY: lint
lint: ## Run style checks and verify syntax
yarn verify
Expand Down
1 change: 0 additions & 1 deletion packages/bsky/.env

This file was deleted.

2 changes: 1 addition & 1 deletion packages/bsky/example.dev.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DB_POSTGRES_URL="postgres://bsky:yksb@localhost/pds_dev"
DB_POSTGRES_URL="postgres://bsky:yksb@localhost/bsky_dev"
DEBUG_MODE=1
LOG_ENABLED="true"
LOG_LEVEL=debug
Expand Down
2 changes: 0 additions & 2 deletions packages/pds/.env

This file was deleted.

0 comments on commit af9f11f

Please sign in to comment.