Ver código fonte

add github action workflows

Daniel Bohry 9 meses atrás
pai
commit
aabd9a40aa
2 arquivos alterados com 68 adições e 0 exclusões
  1. 27 0
      .github/workflows/build.yml
  2. 41 0
      .github/workflows/buildAndRelease.yml

+ 27 - 0
.github/workflows/build.yml

@@ -0,0 +1,27 @@
+name: Build, Test, and Docker Push
+
+on:
+  pull_request:
+    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

+ 41 - 0
.github/workflows/buildAndRelease.yml

@@ -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