diff --git a/.github/workflow/ci.yml b/.github/workflow/ci.yml new file mode 100644 index 00000000..db9f3e66 --- /dev/null +++ b/.github/workflow/ci.yml @@ -0,0 +1,43 @@ +# Goal: Build the image for DevBoard Frontend and Push to Docker Hub, after linting the code +name: CI + +on: + push: + branches: [master] + +jobs: + code-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v7 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" # Automates dependency caching for faster builds + + - name: Install Dependencies + run: npm install + + - name: Run Lint (Biome) + run: npm run lint + + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v7 + + - name: Docker Setup [Login] + uses: docker/login-action@v4 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker Build and Push + uses: docker/build-push-action@v7 + with: + push: true + tags: ${{ vars.DOCKERHUB_USERNAME }}/devboard-fe-master:latest diff --git a/README.md b/README.md index 0866544f..08a9e1f8 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is the same DevBoard UI as the `master` branch, but now the data comes from a **real backend** instead of fake in-memory data. Three pieces talk to each other: - +# sa ``` browser → frontend (React) → backend (Go API) → database (Postgres) ```