Skip to content

Commit

Permalink
Updating github-config
Browse files Browse the repository at this point in the history
  • Loading branch information
paketo-bot committed Mar 19, 2024
1 parent 706f5af commit baf9725
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions .github/workflows/push-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push Buildpackless Builder Image
name: Push Builder Image

on:
release:
Expand All @@ -8,29 +8,34 @@ on:
jobs:
push:
name: Push
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:

- name: Parse Event
id: event
run: |
echo "::set-output name=tag::$(jq -r '.release.tag_name' "${GITHUB_EVENT_PATH}" | sed s/^v//)"
echo "tag=$(jq -r '.release.tag_name' "${GITHUB_EVENT_PATH}" | sed s/^v//)" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get pack version
id: pack-version
run: |
version=$(jq -r .pack "scripts/.util/tools.json")
echo "::set-output name=version::${version#v}"
echo "version=${version#v}" >> "$GITHUB_OUTPUT"
- name: Install Global Pack
uses: buildpacks/github-actions/setup-pack@main
with:
pack-version: ${{ steps.pack-version.outputs.version }}

- name: Enable Experimental Pack Features
run: |
if [ -f "scripts/options.json" ] && jq -e -r .pack_config_enable_experimental "scripts/options.json" > /dev/null; then
pack config experimental true
fi
- name: Create Builder Image
run: |
pack builder create builder --config builder.toml
Expand All @@ -39,8 +44,9 @@ jobs:
env:
PAKETO_BUILDPACKS_DOCKERHUB_USERNAME: ${{ secrets.PAKETO_BUILDPACKS_DOCKERHUB_USERNAME }}
PAKETO_BUILDPACKS_DOCKERHUB_PASSWORD: ${{ secrets.PAKETO_BUILDPACKS_DOCKERHUB_PASSWORD }}
DOCKERHUB_ORG: "paketocommunity"
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
run: |
DOCKERHUB_ORG="${GITHUB_REPOSITORY_OWNER/-/}" # translates 'paketo-buildpacks' to 'paketobuildpacks'
# Strip off the Github org prefix from repo name
# paketo-buildpacks/builder-with-some-name --> builder-with-some-name
registry_repo=$(echo "${{ github.repository }}" | sed 's/^.*\///')
Expand All @@ -51,3 +57,22 @@ jobs:
docker push "${DOCKERHUB_ORG}/${registry_repo}:latest"
docker push "${DOCKERHUB_ORG}/${registry_repo}:${{ steps.event.outputs.tag }}"
failure:
name: Alert on Failure
runs-on: ubuntu-22.04
needs: [push]
if: ${{ always() && needs.push.result == 'failure' }}
steps:
- name: File Failure Alert Issue
uses: paketo-buildpacks/github-config/actions/issue/file@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
label: "failure:push"
comment_if_exists: true
issue_title: "Failure: Push Image workflow"
issue_body: |
Push Image workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}).
comment_body: |
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

0 comments on commit baf9725

Please sign in to comment.