Skip to content

Build and Push Docker Images #3

Build and Push Docker Images

Build and Push Docker Images #3

Workflow file for this run

name: Build and Push Docker Images
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'apps/api/**'
- 'apps/web/**'
- 'packages/**'
jobs:
build-and-push:
name: Build and Push Docker Images
runs-on: ubuntu-latest
if: github.repository == 'refly-ai/refly'
strategy:
matrix:
app: ['api', 'web']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build:web
env:
NODE_OPTIONS: '--max_old_space_size=8192'
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
- 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 Docker Hub
uses: docker/login-action@v3
with:
username: reflyai
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./apps/${{ matrix.app }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
reflyai/refly-${{ matrix.app }}:latest
reflyai/refly-${{ matrix.app }}:${{ github.sha }}