From e5dece5b7beb9e3c82e9e67e6b865e50461ee712 Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Sun, 2 Jun 2024 14:28:42 -0400 Subject: [PATCH] feat: add build and nightly --- .github/workflows/nightly.yaml | 42 ++++++++++++++++++++++++++++++++ .github/workflows/push.yaml | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .github/workflows/nightly.yaml create mode 100644 .github/workflows/push.yaml diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 0000000..80c0467 --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,42 @@ +name: Publish Nightly Docker Image +on: + schedule: + - cron: '0 8 * * *' + workflow_dispatch: + +jobs: + publish: + name: Build and Publish Nightly + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker Metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64, linux/arm64 diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml new file mode 100644 index 0000000..20c8fc6 --- /dev/null +++ b/.github/workflows/push.yaml @@ -0,0 +1,44 @@ +name: 'Build' +on: + push: + branches: + - 'main' + pull_request: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Check out the repo + users: actions/checkout@v4 + + - name: Install node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + version: 9 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm build