From 5ad653ffcb4111a8b1ca13fdbb1a725f6c5cbe12 Mon Sep 17 00:00:00 2001 From: Ari Date: Thu, 25 Aug 2022 11:11:46 -0400 Subject: [PATCH] removing armhf & enabling build caches --- .github/workflows/build.yml | 68 ++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22d7a76..bbbff9b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,12 @@ jobs: outputs: version: ${{ steps.version.outputs.VERSION }} steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.10.0 + with: + all_but_latest: true + access_token: ${{ github.token }} + - name: Check out repository uses: actions/checkout@v3 with: @@ -35,28 +41,12 @@ jobs: run: | echo ${{ steps.version.outputs.VERSION }} - deploy: + build-web: runs-on: ubuntu-latest - name: Build & Publish ${{ matrix.arch }} / ${{ needs.metadata.outputs.version }} - if: github.event_name != 'pull_request' + name: "Build Web" needs: - metadata - strategy: - matrix: - arch: - - "aarch64" - - "amd64" - - "armhf" - - "armv7" - - "i386" - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.10.0 - with: - all_but_latest: true - access_token: ${{ github.token }} - - name: Check out repository uses: actions/checkout@v3 @@ -67,17 +57,49 @@ jobs: cache: "yarn" cache-dependency-path: webapp/yarn.lock + - name: "Save version number" + run: echo "REACT_APP_BUILD_VERSION=${{ needs.metadata.outputs.version }}" > ./webapp/.env.production + + - name: "Build Web" + run: cd webapp && yarn install && yarn build + + - name: "Save artifact" + uses: actions/upload-artifact@v1 + with: + name: "web-${{ needs.metadata.outputs.version }}" + path: webapp/build + + deploy: + runs-on: ubuntu-latest + name: Build & Publish ${{ matrix.arch }} / ${{ needs.metadata.outputs.version }} + if: github.event_name != 'pull_request' + needs: + - metadata + - build-web + strategy: + matrix: + arch: + - "aarch64" + - "amd64" + # - "armhf" + - "armv7" + - "i386" + + steps: + - name: Check out repository + uses: actions/checkout@v3 + - name: Login to DockerHub uses: docker/login-action@v2.0.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: "Save version number" - run: echo "REACT_APP_BUILD_VERSION=${{ needs.metadata.outputs.version }}" > ./webapp/.env.production - - - name: "Build Web" - run: cd webapp && yarn install && yarn build + - name: "Get Web build" + uses: actions/download-artifact@v1 + with: + name: "web-${{ needs.metadata.outputs.version }}" + path: webapp/build - name: ${{ matrix.arch }} / ${{ needs.metadata.outputs.version }} uses: home-assistant/builder@master