From b894942361386692a6bfb6f53ede2706cd745050 Mon Sep 17 00:00:00 2001 From: Jonathan Hernandez Date: Wed, 6 Dec 2023 16:03:42 +0400 Subject: [PATCH] Adding proper extension to the workflow --- .github/workflows/build-develop-image.yaml | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build-develop-image.yaml diff --git a/.github/workflows/build-develop-image.yaml b/.github/workflows/build-develop-image.yaml new file mode 100644 index 00000000..da441b05 --- /dev/null +++ b/.github/workflows/build-develop-image.yaml @@ -0,0 +1,50 @@ +name: Build and push image from develop +on: + pull_request: + types: [ closed ] + branches: + - develop + push: + branches: + - feature/build-claasp-image-workflow + +jobs: + build-image: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Build + uses: docker/build-push-action@v4 + id: built-image + with: + context: . + file: ./docker/Dockerfile + push: true + load: true + tags: tiicrc/claasp-lib:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + env: + DOCKER_USERNAME: devopscrc + DOCKER_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache \ No newline at end of file