Skip to content

Commit

Permalink
Added Disk Space Cleaning Tool (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinp0 authored Feb 12, 2024
2 parents 7579da2 + 33c04da commit 2a90879
Showing 1 changed file with 45 additions and 29 deletions.
74 changes: 45 additions & 29 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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


- name: Login to Docker Hub
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/[email protected]
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/[email protected]

- name: Build and Push Docker Image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/arc:latest

0 comments on commit 2a90879

Please sign in to comment.