Skip to content

Commit

Permalink
fixup! [actions] upload docker image tar to artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
lmnotran committed Jun 19, 2024
1 parent 307002f commit 7c98bc2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
${{ env.SHA_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=oci,dest=${{ env.DOCKER_IMAGE_TAR}}
outputs: type=oci,dest=/tmp/${{ env.DOCKER_IMAGE_TAR}}

# - name: Container image sanity checks
# run: |
Expand Down Expand Up @@ -110,11 +110,14 @@ jobs:
# run: |
# docker run -v ${{ github.workspace }}:/ot-efr32/ --user $(id -u) --rm ${{ env.TEST_TAG }} script/build --skip-silabs-apps brd4151a

- name: Get file type
run: file /tmp/${{ env.DOCKER_IMAGE_TAR }}

- name: Upload docker image
uses: actions/[email protected]
with:
name: ${{ env.DOCKER_IMAGE_ARTIFACT_NAME }}
path: ${{ env.DOCKER_IMAGE_TAR }}
path: /tmp/${{ env.DOCKER_IMAGE_TAR }}

publish:
name: Publish to DockerHub
Expand All @@ -131,15 +134,20 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Download Docker image
id: download
uses: actions/[email protected]
with:
name: ${{ env.DOCKER_IMAGE_ARTIFACT_NAME }}
path: /tmp

- name: Show downloaded Docker image
run: ls -ahl ${{ github.workspace }}
run: ls -ahl ${{ steps.download.outputs.download-path }}/${{ env.DOCKER_IMAGE_TAR }}

- name: Get file type
run: file ${{ steps.download.outputs.download-path }}/${{ env.DOCKER_IMAGE_TAR }}

- name: Load Docker image
run: docker load -i ${{ github.workspace }}/${{ env.DOCKER_IMAGE_TAR }}
run: docker load < ${{ steps.download.outputs.download-path }}/${{ env.DOCKER_IMAGE_TAR }}

- name: Build and push
uses: docker/build-push-action@v5
Expand Down

0 comments on commit 7c98bc2

Please sign in to comment.