diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1089edf6d..13279ce46 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,7 +9,6 @@ on: required: true env: - REGISTRY_NAME: registry.scality.com PROJECT_NAME: ${{ github.event.repository.name }} jobs: @@ -17,39 +16,29 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildk - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Login to Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY_NAME }} - username: ${{ secrets.REGISTRY_LOGIN }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - - name: Push dashboards into the production namespace - run: | - oras push ${{ env.REGISTRY_NAME }}/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}-dashboards:${{ github.event.inputs.tag }} \ - ingestion/ingestion-processor-dashboard.json:application/grafana-dashboard+json \ - ingestion/ingestion-producer-dashboard.json:application/grafana-dashboard+json \ - ingestion/ingestion-global-dashboard.json:application/grafana-dashboard+json \ - ingestion/ingestion-processor-alert.yaml:application/prometheus-alerts+yaml \ - ingestion/ingestion-producer-alert.yaml:application/prometheus-alerts+yaml - working-directory: monitoring + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . push: true - tags: ${{ env.REGISTRY_NAME }}/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}:${{ github.event.inputs.tag }} + tags: ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }} cache-from: type=gha cache-to: type=gha,mode=max - name: Create Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 33b248ce1..67c197041 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,41 +15,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- + uses: actions/checkout@v4 - name: Set up Docker Buildk - uses: docker/setup-buildx-action@v1 - with: - buildkitd-flags: --debug + uses: docker/setup-buildx-action@v3 - name: Login to Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - + password: ${{ github.token }} - name: Build and push kafka - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: push: true context: .github/dockerfiles/kafka - tags: "ghcr.io/scality/backbeat/ci-kafka:${{ github.sha }}" - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - # Temp fix - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache + tags: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }} + cache-from: type=gha,scope=ci-kafka + cache-to: type=gha,mode=max,scope=ci-kafka tests: needs: build @@ -60,10 +42,10 @@ jobs: ports: - 6379:6379 kafka: - image: ghcr.io/scality/backbeat/ci-kafka:${{ github.sha }} + image: ghcr.io/${{ github.repository }}/ci-kafka:${{ github.sha }} credentials: username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ github.token }} ports: - 2181:2181 - 9092:9092 @@ -73,15 +55,16 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get update sudo apt-get install -y build-essential - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v5 with: go-version: '1.16.2' - - uses: actions/setup-node@v2 + cache-dependency-path: ./bucket-scanner/go.sum + - uses: actions/setup-node@v4 with: node-version: '16' cache: yarn