diff --git a/.github/workflows/client_build.yml b/.github/workflows/client_build.yml new file mode 100644 index 00000000..f77d071e --- /dev/null +++ b/.github/workflows/client_build.yml @@ -0,0 +1,39 @@ +name: Build and Publish Client Artifacts + +on: + pull_request: # Change to push when ready to deploy + branches: + - master + paths: + - client/** + - .github/workflows/client_build.yml + +jobs: + client_build: + name: Build and Publish Client Artifacts + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: npm + cache-dependency-path: client/package-lock.json + + - name: Install dependencies + working-directory: ./client + run: npm ci + + - name: Build client + working-directory: ./client + run: npm run build + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: client + path: client/dist diff --git a/.github/workflows/client_test.yml b/.github/workflows/client_test.yml index fafa9730..7dbe6655 100644 --- a/.github/workflows/client_test.yml +++ b/.github/workflows/client_test.yml @@ -6,6 +6,7 @@ on: - master paths: - client/** + - .github/workflows/client_test.yml jobs: client_test: @@ -16,6 +17,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: actions/setup-node@v4 with: node-version: 18 @@ -25,6 +27,7 @@ jobs: - name: Install dependencies working-directory: ./client run: npm ci + - name: Build client working-directory: ./client run: npm run build diff --git a/.github/workflows/server_build.yml b/.github/workflows/server_build.yml index 1a687350..e2e72363 100644 --- a/.github/workflows/server_build.yml +++ b/.github/workflows/server_build.yml @@ -1,11 +1,12 @@ name: Build and Publish Server Artifacts on: - pull_request: + pull_request: # Change to push when ready to deploy branches: - master paths: - server/** + - .github/workflows/server_build.yml jobs: server_build: @@ -13,22 +14,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - arch: - - name: amd64 - platform: linux/amd64 - - name: arm64 - platform: linux/arm64 - - name: armv7 - platform: linux/arm/v7 variant: - - name: bullseye + - name: server-amd64 + platform: linux/amd64 dockerfile: Dockerfile - - name: bookworm + - name: server-arm64 + platform: linux/arm64 dockerfile: Dockerfile.bookworm fail-fast: false - - env: - ARTIFACT_NAME: ${{ matrix.arch.name }}-${{ matrix.variant.name }}-server steps: - name: Checkout repository @@ -53,19 +46,19 @@ jobs: with: context: ./server/ file: ./server/${{ matrix.variant.dockerfile }} - tags: ${{ env.ARTIFACT_NAME }} - platforms: ${{ matrix.arch.platform }} + tags: ${{ matrix.variant.name }} + platforms: ${{ matrix.variant.platform }} load: true - name: Copy artifacts run: | - container_id=$(docker create ${{ env.ARTIFACT_NAME }}) - mkdir -p artifacts/${{ matrix.arch.name }}-${{ matrix.variant.name }} - docker cp $container_id:/src/bin/. artifacts/${{ matrix.arch.name }}-${{ matrix.variant.name }}/ + container_id=$(docker create ${{ matrix.variant.name }}) + mkdir -p artifacts/${{ matrix.variant.name }} + docker cp $container_id:/src/bin/. artifacts/${{ matrix.variant.name }}/ docker rm $container_id - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: ${{ env.ARTIFACT_NAME }} - path: artifacts/${{ matrix.arch.name }}-${{ matrix.variant.name }} + name: ${{ matrix.variant.name }} + path: artifacts/${{ matrix.variant.name }} diff --git a/.github/workflows/server_test.yml b/.github/workflows/server_test.yml index 5ffafe44..7c07c480 100644 --- a/.github/workflows/server_test.yml +++ b/.github/workflows/server_test.yml @@ -6,6 +6,7 @@ on: - master paths: - server/** + - .github/workflows/server_test.yml jobs: server_test: diff --git a/.github/workflows/webpage_deploy.yml b/.github/workflows/webpage_deploy.yml index bdb97280..064b61d2 100644 --- a/.github/workflows/webpage_deploy.yml +++ b/.github/workflows/webpage_deploy.yml @@ -1,4 +1,4 @@ -name: Deploy to GitHub Pages +name: Build and Deploy Webpage to GitHub Pages on: push: @@ -6,10 +6,11 @@ on: - master paths: - webpage/** + - .github/workflows/webpage_deploy.yml jobs: webpage_build: - name: Build Docusaurus + name: Build and Deploy Webpage to GitHub Pages runs-on: ubuntu-latest steps: @@ -25,6 +26,7 @@ jobs: - name: Install dependencies working-directory: ./webpage run: npm ci + - name: Build webpage working-directory: ./webpage run: npm run build diff --git a/.github/workflows/webpage_test.yml b/.github/workflows/webpage_test.yml index 064ff296..1fac2638 100644 --- a/.github/workflows/webpage_test.yml +++ b/.github/workflows/webpage_test.yml @@ -6,6 +6,7 @@ on: - master paths: - webpage/** + - .github/workflows/webpage_test.yml jobs: webpage_test: