forked from kieraneglin/pinchflat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dev] Fix CI caching (kieraneglin#325)
* Consolidated dockerfile commands * Added teardown step * FIxed typo * Got rid of old caching action * Added buildx * Added steps for compiling test ENV to dockerfile * Changed the order of things * Added env vars * more env vars * Removed step * No compile flag * fetch quest * Removed other thing * volumes * Rolling back some other changes * more consolidation * updated checkout runner
- Loading branch information
1 parent
029981b
commit 8dd8e49
Showing
3 changed files
with
42 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,24 +16,28 @@ jobs: | |
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
env: | ||
COMPOSE_FILE: ./docker-compose.ci.yml | ||
MIX_ENV: test | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Pull prebuilt images | ||
run: docker compose pull | ||
|
||
- name: Setup Docker layer caching | ||
uses: jpribyl/[email protected] | ||
continue-on-error: true | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
key: ci-docker-cache-{hash} | ||
restore-keys: | | ||
ci-docker-cache- | ||
layer-ci-docker-cache- | ||
context: . | ||
file: ./docker/dev.Dockerfile | ||
load: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Build and Run Docker image | ||
- name: Run Docker image | ||
run: docker compose up --detach | ||
|
||
# NOTE: All exec commands use the -T flag to compensate for | ||
|
@@ -43,8 +47,7 @@ jobs: | |
# See https://github.com/actions/runner/issues/241 and https://github.com/docker/compose/issues/8537 | ||
- name: Install Elixir and JS deps | ||
run: | | ||
docker compose exec -T phx yarn install && cd assets && yarn install && cd .. | ||
docker compose exec -T phx mix deps.get | ||
docker compose exec -T phx mix deps.get && yarn install && cd assets && yarn install && cd .. | ||
- name: Create and Migrate database | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters