diff --git a/.github/actions/continuous-integration/load-cache/action.yml b/.github/actions/continuous-integration/load-cache/action.yml new file mode 100644 index 00000000..d8fe3191 --- /dev/null +++ b/.github/actions/continuous-integration/load-cache/action.yml @@ -0,0 +1,20 @@ +name: Load cache +description: Loads the cached image in a post-cache continuous integration step +runs: + using: "composite" + steps: + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Load cache image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + build-args: | + RAILS_ENV=test + push: false + load: true + tags: app_test:latest + cache-from: type=gha diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index c8ec1c62..9fee7a66 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -41,20 +41,8 @@ jobs: name: Checkout uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and cache - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile - build-args: | - RAILS_ENV=test - push: false - load: true - tags: app_test:latest - cache-from: type=gha + name: Load cache + uses: ./.github/actions/continuous-integration/load-cache - name: Run linters and formatters run: | @@ -72,20 +60,8 @@ jobs: name: Checkout uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and cache - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile - build-args: | - RAILS_ENV=test - push: false - load: true - tags: app_test:latest - cache-from: type=gha + name: Load cache + uses: ./.github/actions/continuous-integration/load-cache - name: Run Brakeman run: | @@ -100,20 +76,8 @@ jobs: name: Checkout uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and cache - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile - build-args: | - RAILS_ENV=test - push: false - load: true - tags: app_test:latest - cache-from: type=gha + name: Load cache + uses: ./.github/actions/continuous-integration/load-cache - name: Run RSpec and Simplecov run: |