Skip to content

Commit

Permalink
TMP: more
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMind committed Jun 26, 2024
1 parent 89aa203 commit 7027f32
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
21 changes: 18 additions & 3 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
required: false
description: "Docker stage to target"
default: "final"
push:
required: false
description: "Should image be pushed to registries"
default: "false"

outputs:
image:
Expand All @@ -31,6 +35,14 @@ outputs:
runs:
using: "composite"
steps:
- name: Login to Container Registry
if: inputs.push == 'true'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ inputs.username }}
password: ${{ inputs.password }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -51,7 +63,8 @@ runs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.image.outputs.image }}
images: |
ghcr.io/${{ steps.image.outputs.image }}
flavor: |
suffix=-next,onlatest=true
latest=${{ inputs.latest == 'true' }}
Expand Down Expand Up @@ -91,10 +104,12 @@ runs:
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
# Output image to a local tar file to be uploaded
outputs: type=docker,dest=${{ steps.tar.outputs.path }}
# Also push to registry when appropriate
outputs: |
type=docker,dest=${{ steps.tar.outputs.path }}
type=image,name=${{ steps.tag.outputs.tag }},push=${{ inputs.push }}
# Target a specified stage
target: ${{ inputs.target }}
push: true

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ jobs:
with:
node_env: production
latest: ${{ steps.context.outputs.is_release_master }}

- uses: ./.github/actions/push
if: steps.context.outputs.is_fork == 'false'
with:
push: ${{ steps.context.outputs.is_fork == 'false' }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.build.outputs.tag }}

download:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 7027f32

Please sign in to comment.