diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb229d6..8df6c81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,47 @@ on: - main jobs: - build: + build-scancode-base: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Clone scancode-toolkit repository + run: git clone https://github.com/nexB/scancode-toolkit.git + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Cache Docker layers + uses: actions/cache@v4 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push scancode-toolkit Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: scancode-toolkit + file: scancode-toolkit/Dockerfile + push: true + tags: ghcr.io/redhatproductsecurity/licensescanner:scancode-base + + build-wrapper: + needs: build-scancode-base runs-on: ubuntu-latest steps: @@ -63,7 +103,7 @@ jobs: test: runs-on: ubuntu-latest - needs: build + needs: build-wrapper steps: - name: Checkout repository diff --git a/.github/workflows/daily_scancode_build.yml b/.github/workflows/daily_scancode_build.yml deleted file mode 100644 index feabc4a..0000000 --- a/.github/workflows/daily_scancode_build.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Daily Scancode Toolkit Base Image Build - -on: - schedule: - # Runs at 00:00 UTC every day - - cron: '0 0 * * *' - -jobs: - build-scancode-base: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Clone scancode-toolkit repository - run: git clone https://github.com/nexB/scancode-toolkit.git - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push scancode-toolkit Docker image - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 - with: - context: scancode-toolkit - file: scancode-toolkit/Dockerfile - push: true - tags: ghcr.io/redhatproductsecurity/licensescanner:scancode-base