Skip to content

Commit

Permalink
TMP: load image when building
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMind committed Jun 26, 2024
1 parent fd995ef commit 76e19a3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ runs:
DOCKER_TAG: ${{ steps.tag.outputs.tag }}
with:
targets: app
load: true
set: |
*.output=type=docker,dest=${{ steps.tar.outputs.path }}
Expand Down
20 changes: 20 additions & 0 deletions .github/actions/load/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Docker Load image from tar file'
description: 'Loads a docker image from a tar file'
inputs:
version:
required: true
description: "The docker image version you want to load"

runs:
using: "composite"
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.version }}
path: /tmp/

- name: Load image
shell: bash
run: |
docker load < /tmp/${{ inputs.version }}
docker image ls
8 changes: 6 additions & 2 deletions .github/actions/push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@ inputs:
username:
required: false
description: "Username for the registry"
registry:
required: false
description: "The registry to push to"
default: "ghcr.io"

runs:
using: "composite"
steps:
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
password: ${{ inputs.password }}

- name: Push Image
shell: bash
run: |
docker image push ${{ inputs.tag }}
docker image push ${{ inputs.registry }}/${{ inputs.tag }}
12 changes: 2 additions & 10 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
- uses: ./.github/actions/load
with:
name: ${{ needs.build.outputs.version }}
path: /tmp/

- name: Load image
shell: bash
run: |
docker load < /tmp/${{ needs.build.outputs.version }}
docker image ls
version: ${{ needs.build.outputs.version }}


0 comments on commit 76e19a3

Please sign in to comment.