From 1729ce4e008b17feac0c85520669f988fa45d27e Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 16 Jan 2023 10:51:38 +0100 Subject: [PATCH] migrate more builds to depot.dev --- .github/workflows/docker-image-arm.yml | 1 - .github/workflows/docker-image.yml | 82 ++++++-------------------- 2 files changed, 19 insertions(+), 64 deletions(-) diff --git a/.github/workflows/docker-image-arm.yml b/.github/workflows/docker-image-arm.yml index a5f27b22aa..b800699c4a 100644 --- a/.github/workflows/docker-image-arm.yml +++ b/.github/workflows/docker-image-arm.yml @@ -1,7 +1,6 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} - LOCAL_REGISTRY: registry.wimill.xyz name: Build and push arm docker image on: diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c47f04f6c3..06b55073b7 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -9,22 +9,27 @@ on: push: branches: [main] tags: ["*"] - pull_request: - types: [opened, synchronize, reopened] concurrency: group: ${{ github.ref }} cancel-in-progress: true +permissions: + contents: read + id-token: write + packages: write + jobs: build: - runs-on: [self-hosted, new] + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 + - uses: depot/setup-action@v1 - name: Login to registry uses: docker/login-action@v2 @@ -33,36 +38,8 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Docker meta - id: meta-slim - if: github.event_name == 'pull_request' - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-slim - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - - - name: Build and push publicly - uses: docker/build-push-action@v3 - if: github.event_name == 'pull_request' - with: - context: . - push: true - tags: | - ${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-slim:latest - ${{ steps.meta-slim.outputs.tags }} - labels: | - ${{ steps.meta-slim.outputs.labels }} - cache-from: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-slim:buildcache - cache-to: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-slim:buildcache,mode=max - - name: Docker meta id: meta-public - if: github.event_name != 'pull_request' uses: docker/metadata-action@v4 with: images: | @@ -76,46 +53,30 @@ jobs: - name: Build and push publicly if: github.event_name != 'pull_request' - uses: docker/build-push-action@v3 + uses: depot/build-push-action@v1 with: context: . push: true tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - ${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-slim:latest ${{ steps.meta-public.outputs.tags }} labels: | ${{ steps.meta-public.outputs.labels }} org.opencontainers.image.licenses=AGPLv3 - cache-from: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-slim:buildcache - cache-to: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-slim:buildcache,mode=max - + build_ee: - runs-on: [self-hosted, new] + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Docker meta - id: meta-slim - if: github.event_name == 'pull_request' - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-slim - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 + - uses: depot/setup-action@v1 - name: Docker meta id: meta-ee-public - if: github.event_name != 'pull_request' uses: docker/metadata-action@v4 with: images: | @@ -128,15 +89,13 @@ jobs: - name: Login to registry uses: docker/login-action@v2 - if: github.event_name != 'pull_request' with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push publicly ee - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v3 + uses: depot/build-push-action@v1 with: context: . push: true @@ -149,8 +108,7 @@ jobs: labels: | ${{ steps.meta-ee-public.outputs.labels }} org.opencontainers.image.licenses=Windmill-Enterprise-License - cache-from: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-ee:buildcache - cache-to: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-ee:buildcache,mode=max + playwright: runs-on: [self-hosted, new] @@ -172,7 +130,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: "Docker" - run: echo "::set-output name=id::$(docker run --network=host --rm -d -p 8000:8000 --privileged -it -e DATABASE_URL=postgres://admin:changeme@localhost:5432/windmill -e BASE_INTERNAL_URL=http://localhost:8000 ${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-slim:latest)" + run: echo "::set-output name=id::$(docker run --network=host --rm -d -p 8000:8000 --privileged -it -e DATABASE_URL=postgres://admin:changeme@localhost:5432/windmill -e BASE_INTERNAL_URL=http://localhost:8000 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-slim:latest)" id: docker-container - uses: actions/setup-node@v3 with: @@ -188,7 +146,6 @@ jobs: publish_privately_heavy: needs: [build_ee] runs-on: [self-hosted, new] - if: github.event_name != 'pull_request' steps: - uses: actions/checkout@v3 with: @@ -202,7 +159,6 @@ jobs: with: images: | ${{ env.ECR_REGISTRY }}/${{ env.IMAGE_NAME }} - ${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=ref,event=branch type=ref,event=pr