From 984078db762df995fcc94f99e207b012966012e8 Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Wed, 12 Jul 2023 16:26:07 +0200 Subject: [PATCH] parallelize ci workflow --- .github/workflows/build-deploy.yml | 71 +++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 8c67101d..a4b0ba6f 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -6,8 +6,8 @@ on: types: [published] jobs: - build: - name: Build + build-amd64: + name: Build (amd64) runs-on: ubuntu-latest strategy: @@ -16,9 +16,6 @@ jobs: image: - client - server - platform: - - linux/amd64 - - linux/arm64 steps: - name: Checkout the repository @@ -62,7 +59,67 @@ jobs: with: context: . push: true - platforms: ${{ matrix.platform }} + platforms: linux/amd64 + file: ${{ matrix.image }}/Dockerfile + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + build-args: | + TURBO_TOKEN=${{ secrets.TURBO_TOKEN }} + + build-arm64: + name: Build (arm64) + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + image: + - client + - server + + steps: + - name: Checkout the repository + uses: actions/checkout@v3.5.3 + + - name: Retrieve version from package.json + id: version + uses: martinbeentjes/npm-get-version-action@v1.3.1 + + - name: Docker Metadaata + id: meta + uses: docker/metadata-action@v4.6.0 + with: + images: amruthpillai/reactive-resume + tags: | + type=raw,value=${{ matrix.image }}-latest + type=raw,value=${{ matrix.image }}-${{ steps.version.outputs.current-version }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2.2.0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.9.0 + + - name: Login to Docker Hub + uses: docker/login-action@v2.2.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2.2.0 + with: + registry: ghcr.io + username: $GITHUB_REPOSITORY_OWNER + password: ${{ secrets.GH_TOKEN }} + + - name: Build and Push + id: build + uses: docker/build-push-action@v4.1.1 + with: + context: . + push: true + platforms: linux/arm64 file: ${{ matrix.image }}/Dockerfile labels: ${{ steps.meta.outputs.labels }} tags: ${{ steps.meta.outputs.tags }} @@ -73,7 +130,7 @@ jobs: name: Deploy runs-on: ubuntu-latest - needs: build + needs: build-amd64 steps: - name: Install DigitalOcean CLI diff --git a/package.json b/package.json index 752c0270..6ca50a87 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reactive-resume", - "version": "3.8.0", + "version": "3.8.1", "private": true, "scripts": { "dev": "env-cmd --silent cross-var cross-env VERSION=$npm_package_version turbo run dev",