mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-02-23 10:31:22 +01:00
Add --quiet flag to push, add success msg
Signed-off-by: Tim Etchells <tetchell@redhat.com>
This commit is contained in:
parent
61095317bf
commit
e91c7f612e
4 changed files with 10 additions and 12 deletions
15
README.md
15
README.md
|
@ -22,7 +22,7 @@ Push-to-registry is a GitHub Action for pushing an OCI-compatible image to an im
|
||||||
<td>image</td>
|
<td>image</td>
|
||||||
<td>Yes</td>
|
<td>Yes</td>
|
||||||
<td>
|
<td>
|
||||||
Name of the image you want to push. Most likely the name you used to create the image in the previous step.
|
Name of the image you want to push.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ Push-to-registry is a GitHub Action for pushing an OCI-compatible image to an im
|
||||||
<td>registry</td>
|
<td>registry</td>
|
||||||
<td>Yes</td>
|
<td>Yes</td>
|
||||||
<td>URL of the registry to push the image to.<br>
|
<td>URL of the registry to push the image to.<br>
|
||||||
Eg. <code>https://quay.io/<username></code></td>
|
Eg. <code>quay.io/<username></code></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -72,13 +72,10 @@ jobs:
|
||||||
BUILT_JAR: "target/spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar"
|
BUILT_JAR: "target/spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
- run: mvn package
|
||||||
|
|
||||||
- name: Maven
|
|
||||||
run: |
|
|
||||||
cd ${GITHUB_WORKSPACE}
|
|
||||||
mvn package
|
|
||||||
- name: Build Image
|
- name: Build Image
|
||||||
uses: redhat-actions/buildah-action@0.0.1
|
uses: redhat-actions/buildah-action@0.0.1
|
||||||
with:
|
with:
|
||||||
|
@ -91,7 +88,7 @@ jobs:
|
||||||
${{ env.BUILT_JAR }}
|
${{ env.BUILT_JAR }}
|
||||||
port: 8080
|
port: 8080
|
||||||
- name: Push To Quay
|
- name: Push To Quay
|
||||||
uses: redhat-actions/push-to-registry@0.0.1
|
uses: redhat-actions/push-to-registry@v1
|
||||||
with:
|
with:
|
||||||
image: ${{ env.IMAGE_NAME }}
|
image: ${{ env.IMAGE_NAME }}
|
||||||
registry: ${{ secrets.QUAY_REPO }}
|
registry: ${{ secrets.QUAY_REPO }}
|
||||||
|
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -35,10 +35,11 @@ export async function run(): Promise<void> {
|
||||||
|
|
||||||
// push image
|
// push image
|
||||||
const registryUrl = `${registry.replace(/\/$/, '')}/${imageToPush}`;
|
const registryUrl = `${registry.replace(/\/$/, '')}/${imageToPush}`;
|
||||||
const push: CommandResult = await execute(podman, ['push', '--creds', `${username}:${password}`, `${imageToPush}`, `${registryUrl}`]);
|
const push: CommandResult = await execute(podman, ['push', '--quiet', '--creds', `${username}:${password}`, `${imageToPush}`, `${registryUrl}`]);
|
||||||
if (push.succeeded === false) {
|
if (push.succeeded === false) {
|
||||||
return Promise.reject(new Error(push.reason));
|
return Promise.reject(new Error(push.reason));
|
||||||
}
|
}
|
||||||
|
core.info(`Successfully pushed ${imageToPush} to ${registryUrl}.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function execute(executable: string, args: string[]): Promise<CommandResult> {
|
async function execute(executable: string, args: string[]): Promise<CommandResult> {
|
||||||
|
|
Loading…
Add table
Reference in a new issue