|
@@ -0,0 +1,41 @@
|
|
|
|
|
+name: Build, Test, and Docker Push
|
|
|
|
|
+
|
|
|
|
|
+on:
|
|
|
|
|
+ push:
|
|
|
|
|
+ branches: [ main ]
|
|
|
|
|
+
|
|
|
|
|
+jobs:
|
|
|
|
|
+ build:
|
|
|
|
|
+ runs-on: ubuntu-latest
|
|
|
|
|
+
|
|
|
|
|
+ steps:
|
|
|
|
|
+ - name: Checkout code
|
|
|
|
|
+ uses: actions/checkout@v3
|
|
|
|
|
+
|
|
|
|
|
+ - name: Set up Node.js
|
|
|
|
|
+ uses: actions/setup-node@v3
|
|
|
|
|
+ with:
|
|
|
|
|
+ node-version: '20.9.0'
|
|
|
|
|
+
|
|
|
|
|
+ - name: Install dependencies
|
|
|
|
|
+ run: npm install
|
|
|
|
|
+
|
|
|
|
|
+ - name: Run lint checks
|
|
|
|
|
+ run: npm run lint
|
|
|
|
|
+
|
|
|
|
|
+ - name: Build the application
|
|
|
|
|
+ run: npm run build
|
|
|
|
|
+
|
|
|
|
|
+ - name: Set up Docker Buildx
|
|
|
|
|
+ uses: docker/setup-buildx-action@v2
|
|
|
|
|
+
|
|
|
|
|
+ - name: Log in to Docker Hub
|
|
|
|
|
+ uses: docker/login-action@v2
|
|
|
|
|
+ with:
|
|
|
|
|
+ username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
|
+ password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
|
+
|
|
|
|
|
+ - name: Build and push multi-platform Docker images
|
|
|
|
|
+ run: |
|
|
|
|
|
+ docker buildx create --use
|
|
|
|
|
+ docker buildx build --platform linux/amd64,linux/arm64 -t lhamacorp/oquokka-fe:latest . --push
|