feat(ops): Update Docker workflow for PRs on main branch (#813)
This commit is contained in:
parent
fa06787f27
commit
cfca211063
|
|
@ -1,6 +1,11 @@
|
||||||
name: Docker
|
name: Docker
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'ci/Dockerfile*'
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
@ -22,9 +27,10 @@ jobs:
|
||||||
id: get_version
|
id: get_version
|
||||||
run: |
|
run: |
|
||||||
VERSION=${GITHUB_REF#refs/tags/}
|
VERSION=${GITHUB_REF#refs/tags/}
|
||||||
if [[ ${GITHUB_REF} == "refs/heads/main" ]]; then
|
if [[ ${GITHUB_REF} == "refs/heads/main" || ${GITHUB_REF} =~ refs/pull/([0-9]+)/merge ]]; then
|
||||||
VERSION=latest
|
VERSION=latest
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Get Git Revision
|
- name: Get Git Revision
|
||||||
|
|
@ -80,7 +86,7 @@ jobs:
|
||||||
tags: |
|
tags: |
|
||||||
dragonflyoss/client:${{ steps.get_version.outputs.VERSION }}
|
dragonflyoss/client:${{ steps.get_version.outputs.VERSION }}
|
||||||
ghcr.io/${{ env.IMAGE_REPOSITORY }}:${{ steps.get_version.outputs.VERSION }}
|
ghcr.io/${{ env.IMAGE_REPOSITORY }}:${{ steps.get_version.outputs.VERSION }}
|
||||||
push: true
|
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||||
|
|
||||||
|
|
@ -103,9 +109,10 @@ jobs:
|
||||||
id: get_version
|
id: get_version
|
||||||
run: |
|
run: |
|
||||||
VERSION=${GITHUB_REF#refs/tags/}
|
VERSION=${GITHUB_REF#refs/tags/}
|
||||||
if [[ ${GITHUB_REF} == "refs/heads/main" ]]; then
|
if [[ ${GITHUB_REF} == "refs/heads/main" || ${GITHUB_REF} =~ refs/pull/([0-9]+)/merge ]]; then
|
||||||
VERSION=latest
|
VERSION=latest
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Get Git Revision
|
- name: Get Git Revision
|
||||||
|
|
@ -161,7 +168,7 @@ jobs:
|
||||||
tags: |
|
tags: |
|
||||||
dragonflyoss/dfinit:${{ steps.get_version.outputs.VERSION }}
|
dragonflyoss/dfinit:${{ steps.get_version.outputs.VERSION }}
|
||||||
ghcr.io/${{ env.IMAGE_REPOSITORY }}/dfinit:${{ steps.get_version.outputs.VERSION }}
|
ghcr.io/${{ env.IMAGE_REPOSITORY }}/dfinit:${{ steps.get_version.outputs.VERSION }}
|
||||||
push: true
|
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ COPY --from=builder /app/client/target/release/dfget /usr/local/bin/dfget
|
||||||
COPY --from=builder /app/client/target/release/dfdaemon /usr/local/bin/dfdaemon
|
COPY --from=builder /app/client/target/release/dfdaemon /usr/local/bin/dfdaemon
|
||||||
COPY --from=builder /app/client/target/release/dfstore /usr/local/bin/dfstore
|
COPY --from=builder /app/client/target/release/dfstore /usr/local/bin/dfstore
|
||||||
COPY --from=builder /app/client/target/release/dfcache /usr/local/bin/dfcache
|
COPY --from=builder /app/client/target/release/dfcache /usr/local/bin/dfcache
|
||||||
COPY --from=health /bin/grpc_health_probe /bin/grpc_health_probe
|
|
||||||
COPY --from=pprof /go/bin/pprof /bin/pprof
|
COPY --from=pprof /go/bin/pprof /bin/pprof
|
||||||
|
COPY --from=health /bin/grpc_health_probe /bin/grpc_health_probe
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/dfdaemon"]
|
ENTRYPOINT ["/usr/local/bin/dfdaemon"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue