diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index fbfa07bec3..a82456729e 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -5,44 +5,60 @@ on: - cron: "0 0 */7 * *" # every 7 days push: branches: - - main + - main + paths: + - "Dockerfile" + - ".github/workflows/docker_build.yml" pull_request: branches: - - main + - main paths: - - './Dockerfile' + - "Dockerfile" + - ".github/workflows/docker_build.yml" + types: [opened, synchronize, reopened, ready_for_review, review_requested] + #workflow_dispatch: # Add this line to enable manual trigger + jobs: - ci-check: - if: github.event_name == 'pull_request' + build: runs-on: ubuntu-latest steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: false + swap-storage: true - name: Checkout uses: actions/checkout@v2 - - name: Build ARC - uses: docker/build-push-action@v2 + + - name: Build Docker Image (No Push) + if: github.event_name == 'pull_request' || github.event_name == 'push' + uses: docker/build-push-action@v5.1.0 with: context: . file: ./Dockerfile push: false - - build-and-push: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Build and push ARC - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/arc:latest - \ No newline at end of file + + - name: Login to Docker Hub + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: docker/login-action@v3.0.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: docker/setup-buildx-action@v3.0.0 + + - name: Build and Push Docker Image + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: docker/build-push-action@v5.1.0 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/arc:latest