diff --git a/.woodpecker/api.yml b/.woodpecker/api.yml index 62028c1..0202f26 100644 --- a/.woodpecker/api.yml +++ b/.woodpecker/api.yml @@ -42,10 +42,11 @@ steps: - apt-get update && apt-get install -y --no-install-recommends libglib2.0-0 - .venv/bin/pytest tests/integration/ tests/regression/ tests/e2e/ tests/test_listing_geojson.py -v --tb=short - - name: build-api-image - image: plugins/docker - environment: - DOCKER_BUILDKIT: 1 + - name: build-and-push-api + image: woodpeckerci/plugin-docker-buildx + depends_on: + - test-unit + - test-integration settings: username: viktorbarzin password: @@ -54,31 +55,16 @@ steps: dockerfile: Dockerfile context: . target: production - cache_from: - - viktorbarzin/realestatecrawler:latest - - viktorbarzin/realestatecrawler:builder - tags: - - "build-${CI_PIPELINE_NUMBER}" - - - name: publish-api-image - image: alpine - depends_on: - - test-unit - - test-integration - - build-api-image - environment: - DOCKERHUB_TOKEN: - from_secret: dockerhub-token - commands: - - apk add --no-cache skopeo - - 'skopeo copy --src-creds "viktorbarzin:$DOCKERHUB_TOKEN" --dest-creds "viktorbarzin:$DOCKERHUB_TOKEN" "docker://docker.io/viktorbarzin/realestatecrawler:build-${CI_PIPELINE_NUMBER}" "docker://docker.io/viktorbarzin/realestatecrawler:${CI_PIPELINE_NUMBER}"' - - 'skopeo copy --src-creds "viktorbarzin:$DOCKERHUB_TOKEN" --dest-creds "viktorbarzin:$DOCKERHUB_TOKEN" "docker://docker.io/viktorbarzin/realestatecrawler:build-${CI_PIPELINE_NUMBER}" "docker://docker.io/viktorbarzin/realestatecrawler:latest"' - - 'skopeo copy --src-creds "viktorbarzin:$DOCKERHUB_TOKEN" --dest-creds "viktorbarzin:$DOCKERHUB_TOKEN" "docker://docker.io/viktorbarzin/realestatecrawler:build-${CI_PIPELINE_NUMBER}" "docker://docker.io/viktorbarzin/realestatecrawler:builder"' + platforms: + - linux/amd64 + tag: ["${CI_PIPELINE_NUMBER}", "latest"] + cache_from: "viktorbarzin/realestatecrawler:latest" + cache_to: "type=inline" - name: update-deployment image: alpine depends_on: - - publish-api-image + - build-and-push-api commands: - apk add --no-cache curl jq - | diff --git a/.woodpecker/frontend.yml b/.woodpecker/frontend.yml index 43b5c70..e5c58c7 100644 --- a/.woodpecker/frontend.yml +++ b/.woodpecker/frontend.yml @@ -53,8 +53,13 @@ steps: commands: - cd frontend && npx vitest run --reporter=verbose --shard=4/4 - - name: build-frontend-image - image: plugins/docker + - name: build-and-push-frontend + image: woodpeckerci/plugin-docker-buildx + depends_on: + - test-shard-1 + - test-shard-2 + - test-shard-3 + - test-shard-4 settings: username: viktorbarzin password: @@ -63,31 +68,16 @@ steps: dockerfile: frontend/Dockerfile context: frontend target: production - cache_from: - - viktorbarzin/immoweb:latest - tags: - - "build-${CI_PIPELINE_NUMBER}" - - - name: publish-frontend-image - image: alpine - depends_on: - - test-shard-1 - - test-shard-2 - - test-shard-3 - - test-shard-4 - - build-frontend-image - environment: - DOCKERHUB_TOKEN: - from_secret: dockerhub-token - commands: - - apk add --no-cache skopeo - - 'skopeo copy --src-creds "viktorbarzin:$DOCKERHUB_TOKEN" --dest-creds "viktorbarzin:$DOCKERHUB_TOKEN" "docker://docker.io/viktorbarzin/immoweb:build-${CI_PIPELINE_NUMBER}" "docker://docker.io/viktorbarzin/immoweb:${CI_PIPELINE_NUMBER}"' - - 'skopeo copy --src-creds "viktorbarzin:$DOCKERHUB_TOKEN" --dest-creds "viktorbarzin:$DOCKERHUB_TOKEN" "docker://docker.io/viktorbarzin/immoweb:build-${CI_PIPELINE_NUMBER}" "docker://docker.io/viktorbarzin/immoweb:latest"' + platforms: + - linux/amd64 + tag: ["${CI_PIPELINE_NUMBER}", "latest"] + cache_from: "viktorbarzin/immoweb:latest" + cache_to: "type=inline" - name: update-deployment image: alpine depends_on: - - publish-frontend-image + - build-and-push-frontend commands: - apk add --no-cache curl jq - |