Merge pull request #600 from unity-sds/develop #99
This file contains hidden or 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
| name: Build Docker file CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| # pull_request: | |
| # branches: [ main ] | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v3 | |
| with: | |
| python-version: '3.9' | |
| - run: | | |
| # make file runnable, might not be necessary | |
| chmod +x "${GITHUB_WORKSPACE}/ci.cd/store_version.sh" | |
| # run script | |
| "${GITHUB_WORKSPACE}/ci.cd/store_version.sh" | |
| - | |
| name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| with: | |
| buildkitd-flags: --debug | |
| - | |
| name: Login to DockerHub | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # with: | |
| # username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| # password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - | |
| name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - | |
| name: Cache Docker layers | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-buildx-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-buildx- | |
| - | |
| name: Build and push | |
| uses: docker/build-push-action@v3 | |
| with: | |
| builder: ${{ steps.buildx.outputs.name }} | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,dest=/tmp/.buildx-cache | |
| context: "{{defaultContext}}" | |
| file: "docker/Dockerfile_download_granules.public" | |
| push: true | |
| tags: "${{ env.REGISTRY }}/unity-sds/unity-data-services:${{ env.software_version }}" |