Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0d17766

Browse files
committedJun 26, 2024·
TMP: more stuff idk will work
1 parent fccfdbd commit 0d17766

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed
 

‎.github/actions/build/action.yml

+26-21
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,21 @@ inputs:
99
required: false
1010
description: "Tag latest version"
1111
default: "false"
12+
target:
13+
required: false
14+
description: "Docker stage to target"
15+
default: "final"
1216

1317
outputs:
14-
version:
15-
description: "The version for the image"
16-
value: ${{ steps.meta.outputs.version }}
1718
image:
1819
description: "The Docker image"
1920
value: ${{ steps.image.outputs.image }}
21+
version:
22+
description: "The version for the image"
23+
value: ${{ steps.meta.outputs.version }}
24+
digest:
25+
description: "The build digest for the image"
26+
value: ${{ steps.build.outputs.digest }}
2027
tag:
2128
description: "Combines image and version to a valid image tag"
2229
value: ${{ steps.tag.outputs.tag }}
@@ -76,25 +83,17 @@ runs:
7683
7784
- name: Build Image
7885
id: build
79-
uses: docker/bake-action@v4
80-
env:
81-
DOCKER_TAG: ${{ steps.tag.outputs.tag }}
86+
uses: docker/build-push-action@v6
8287
with:
83-
targets: app
84-
load: true
85-
86-
- name: Get image digest
87-
id: digest
88-
shell: bash
89-
run: |
90-
echo '${{ steps.build.outputs.metadata }}' > metadata.json
91-
echo "digest=$(cat metadata.json | jq -r '.app."containerimage.digest"')" >> $GITHUB_OUTPUT
92-
cat $GITHUB_OUTPUT
93-
94-
- name: Save Docker Image to Tar
95-
shell: bash
96-
run: |
97-
docker save -o /tmp/image.tar ${{ steps.tag.outputs.tag }}
88+
platforms: linux/amd64
89+
# Inject metadata produced earlier
90+
tags: ${{ steps.meta.outputs.tags }}
91+
labels: ${{ steps.meta.outputs.labels }}
92+
annotations: ${{ steps.meta.outputs.annotations }}
93+
# Output image to a local tar file to be uploaded
94+
outputs: type=docker,dest=${{ steps.tar.outputs.path }}
95+
# Target a specified stage
96+
target: ${{ inputs.target }}
9897

9998
- name: Upload artifact
10099
uses: actions/upload-artifact@v4
@@ -106,3 +105,9 @@ runs:
106105
retention-days: 1
107106
compression-level: 9
108107
overwrite: true
108+
109+
- name: Load Docker image
110+
shell: bash
111+
run: |
112+
# Load the Docker image
113+
docker load -i /tmp/image.tar

‎docker-compose.yml

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ version: '3.8'
22
services:
33
app:
44
image: ${DOCKER_TAG:-}
5-
build:
6-
context: .
7-
args:
8-
NODE_ENV: development
95
volumes:
106
- node_modules:/app/node_modules
117
- dist:/app/dist

0 commit comments

Comments
 (0)
Please sign in to comment.