Skip to content

Commit

Permalink
Use docker image pull to pull from GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Jan 28, 2025
1 parent 9d50fc2 commit 020aa58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push docker image
- name: Build and push docker image to GHCR
working-directory: docker/test
run: >
docker buildx bake
Expand Down Expand Up @@ -67,16 +67,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Pull docker image
- name: Pull MaMpf image (from GHCR)
working-directory: docker/test
run: >
docker compose
-f docker-compose.yml -f docker-compose.cicd.yml
-f ./../../.github/workflows/docker-compose-cache.json
pull mampf
docker image pull ghcr.io/mampf-hd/mampf-test:cache
- name: Run unit tests
working-directory: docker/test
Expand Down Expand Up @@ -106,9 +100,6 @@ jobs:
with:
submodules: recursive

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

# see https://github.com/orgs/MaMpf-HD/packages?repo_name=mampf
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -117,13 +108,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull docker image
- name: Pull MaMpf image (from GHCR)
working-directory: docker/test
run: >
docker compose
-f docker-compose.yml -f docker-compose.cicd.yml
-f ./../../.github/workflows/docker-compose-cache.json
pull mampf
docker image pull ghcr.io/mampf-hd/mampf-test:cache
- name: Run Cypress tests
working-directory: docker/test
Expand Down
2 changes: 1 addition & 1 deletion docker/development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ RUN if [ "$IN_CI_CD" = "true" ]; then \
# (NODE_ENVtest-ci to trigger respective webpacker.yml section)
COPY . /usr/src/app/
RUN if [ "$IN_CI_CD" = "true" ]; then \
echo "Compiling MaMpf assets in CI/CD"; \
echo "Compiling MaMpf assets in pipeline"; \
set -o allexport; . ./docker/production/docker.env; set +o allexport; \
SECRET_KEY_BASE="$(bundle exec rails secret)" \
DB_ADAPTER=nulldb NODE_ENV=test-ci bundle exec rails assets:precompile; \
Expand Down

0 comments on commit 020aa58

Please sign in to comment.