Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker image cache #23

Open
SergeyShorokhov opened this issue Oct 17, 2024 · 1 comment
Open

Add docker image cache #23

SergeyShorokhov opened this issue Oct 17, 2024 · 1 comment
Labels
github_actions Pull requests that update GitHub Actions code

Comments

@SergeyShorokhov
Copy link
Member

@SergeyShorokhov SergeyShorokhov added the github_actions Pull requests that update GitHub Actions code label Oct 17, 2024
@SergeyShorokhov
Copy link
Member Author

I tried and it didn't work. We need to find a way to cache Docker build without using the docker-build-push action.

steps:
      - uses: actions/checkout@v4

      - uses: actions/cache@v4
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-docker-${{ matrix.test.type }}
          restore-keys: |
            ${{ runner.os }}-docker-
        
      - name: Prepare
        working-directory: ./testdemos_files
        run: rsync -a deps/${{ matrix.test.type }}/* .

      - name: Build container
        run: |
          docker build \
          --cache-from=type=gha \
          --cache-to=type=gha,mode=max \
          -t $imageName .

      - name: Run test
        if: false
        env:
          demo: ${{ matrix.test.file }}
          desc: ${{ matrix.test.desc }}
        run: |
          docker run \
            --env demo \
            --env desc \
            -t $imageName \
            ./runTest.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_actions Pull requests that update GitHub Actions code
Projects
None yet
Development

No branches or pull requests

1 participant