diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml index 66699b2088..a86ed9962e 100644 --- a/.github/workflows/client.yml +++ b/.github/workflows/client.yml @@ -13,8 +13,19 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: satackey/action-docker-layer-caching@v0.0.11 - continue-on-error: true # ignore the failure of a step and avoid terminating the job + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx-${{ github.ref }}- + ${{ runner.os }}-buildx- + # TODO: This step was left here intentionally so we can track disk space # usage for a while. We were trying to fight problems with out of disk space # that happened due to the size of data restored from cache. The cache size @@ -22,13 +33,19 @@ jobs: # available disk space for `/`. Fresh execution starts with 20 GB, we expect # to have no less than 15 GB after the cache is restored. - run: sudo df -h - - name: Run Docker build - run: | - docker build \ - --target gobuild \ - --tag go-build-env . - docker build \ - --tag keep-client . + + - name: Build Docker Build Image + uses: docker/build-push-action@v2 + with: + target: gobuild + tags: go-build-env + build-args: | + REVISION=${{ github.sha }} + # VERSION= ? TODO: Configure version, sample: 1.7.6 + load: true # load image to local registry to use it in next steps + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + - name: Create test results directory run: | mkdir test-results @@ -47,3 +64,15 @@ jobs: files: ./test-results/unit-tests.xml check_name: Go Test Results # name under which test results will be presented in GitHub (optional) comment_on_pr: false # turns off commenting on Pull Requests + + # This step is executed after the tests as we want to configure it eventually + # as image publication step. + - name: Build Docker Runtime Image + uses: docker/build-push-action@v2 + with: + tags: keep-client + labels: | + revision=${{ github.sha }} + # TODO: Check branch name and publish to a registry accordingly to the + # environment. + # push: true # publish to registry