aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/docker.yml52
-rw-r--r--.github/workflows/main.yml36
2 files changed, 88 insertions, 0 deletions
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
new file mode 100644
index 00000000..27c41d7e
--- /dev/null
+++ b/.github/workflows/docker.yml
@@ -0,0 +1,52 @@
+name: Build and Push Docker
+on:
+ release:
+ types:
+ - created
+ push:
+ branches:
+ - main
+jobs:
+ push:
+ strategy:
+ matrix:
+ package: [web, workers]
+ runs-on: ubuntu-latest
+ permissions:
+ packages: write
+ contents: read
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Login to Github Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Build ${{ matrix.package }}
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ file: docker/Dockerfile
+ target: ${{ matrix.package }}
+ push: true
+ tags: ghcr.io/mohamedbassem/hoarder-${{ matrix.package }}:latest
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
+
+ - name: Build ${{ matrix.package }} (release)
+ uses: docker/build-push-action@v5
+ if: github.event_name == 'release'
+ with:
+ context: .
+ file: docker/Dockerfile
+ target: ${{ matrix.package }}
+ push: true
+ tags: ghcr.io/mohamedbassem/hoarder-${{ matrix.package }}:${{github.event.release.name}}
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 00000000..1662bbe9
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,36 @@
+name: Build and lint
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+jobs:
+ build-lint:
+ name: Build and Lint
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ # This is a workaround for: https://github.com/actions/setup-node/issues/899
+ - name: Enable Corepack before setting up Node
+ run: corepack enable
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 21
+ cache: "pnpm"
+ - name: Install deps
+ env:
+ PUPPETEER_SKIP_DOWNLOAD: true
+ run: pnpm install
+ - name: Format
+ run: pnpm format:check
+ - name: Lint
+ run: pnpm lint
+ - name: Build the workers package
+ working-directory: packages/workers
+ run: pnpm typecheck
+ - name: Build web app
+ working-directory: packages/web
+ run: pnpm run build
+ - name: Build the browser extension
+ working-directory: packages/browser-extension
+ run: pnpm build