diff --git a/.github/workflows/buiild.yml b/.github/workflows/buiild.yml new file mode 100644 index 0000000..2f8380e --- /dev/null +++ b/.github/workflows/buiild.yml @@ -0,0 +1,61 @@ +name: Build and publish image to ghcr.io/epics-containers + +on: + push: + pull_request: + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Determine container image tag to use + id: tag + run: | + # tag is branch name or tag if there is a tag + echo ::set-output name=image_tag::${GITHUB_REF##*/} + echo ::set-output name=do_push::true + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Log in to GitHub Docker Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io/epics-containers + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Build developer image + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + push: ${{ steps.tag.outputs.do_push }} + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.image_tag }} + + # - name: Build runtime image + # uses: docker/build-push-action@v5 + # with: + # builder: ${{ steps.buildx.outputs.name }} + # push: ${{ steps.tag.outputs.do_push }} + # tags: | + # ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.image_tag }}.run + # target: runtime + # cache-from: type=local,src=/tmp/.buildx-cache + # cache-to: type=local,dest=/tmp/.buildx-cache + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1c2bf1c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.11 + +RUN python -mvenv /venv +ENV PATH=/venv/bin:$PATH + +# don't use numpy 2.0 yet, pin to latest 1.x version +RUN pip install numpy=1.26.4 p4p nose2 +