Skip to content

Commit

Permalink
Merge pull request #144 from puppetlabs/CDPE-6528/automate-puppet-dev…
Browse files Browse the repository at this point in the history
…-tools

(CDPE-6528) Input image tag name to Build-Test-Push
  • Loading branch information
nwolfe authored Feb 28, 2024
2 parents 2afdc69 + b87862d commit dee7d91
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build-test-push.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: Build-Test-Push

on:
workflow_dispatch:
inputs:
tag:
description: Optional tag to create in addition to the `latest` and `<timestamp>-<sha>` image tags.
required: false
push:
branches:
- main

jobs:
Build-Test-Push:
runs-on: ubuntu-latest
Expand All @@ -29,6 +35,11 @@ jobs:
run: |
docker tag puppet-dev-tools:latest-rootless ${{ secrets.DOCKERHUB_PUSH_USERNAME }}/puppet-dev-tools:$(date +"%F")-$(git rev-parse --short HEAD)-rootless
docker tag puppet-dev-tools:latest ${{ secrets.DOCKERHUB_PUSH_USERNAME }}/puppet-dev-tools:$(date +"%F")-$(git rev-parse --short HEAD)
- name: Additional Tag
if: inputs.tag
run: |
docker tag puppet-dev-tools:latest-rootless ${{ secrets.DOCKERHUB_PUSH_USERNAME }}/puppet-dev-tools:${{ inputs.tag }}-rootless
docker tag puppet-dev-tools:latest ${{ secrets.DOCKERHUB_PUSH_USERNAME }}/puppet-dev-tools:${{ inputs.tag }}
- name: List Docker images
run: docker images --filter "reference=puppet-dev-tools*" --filter "reference=*/puppet-dev-tools*"
- name: Show Docker image labels
Expand All @@ -40,3 +51,8 @@ jobs:
run: |
docker push ${{ secrets.DOCKERHUB_PUSH_USERNAME }}/puppet-dev-tools:$(date +"%F")-$(git rev-parse --short HEAD)-rootless
docker push ${{ secrets.DOCKERHUB_PUSH_USERNAME }}/puppet-dev-tools:$(date +"%F")-$(git rev-parse --short HEAD)
- name: Push Additional Tag
if: inputs.tag
run: |
docker push ${{ secrets.DOCKERHUB_PUSH_USERNAME }}/puppet-dev-tools:${{ inputs.tag }}-rootless
docker push ${{ secrets.DOCKERHUB_PUSH_USERNAME }}/puppet-dev-tools:${{ inputs.tag }}

0 comments on commit dee7d91

Please sign in to comment.