Skip to content

Commit

Permalink
Merge pull request #380 from paketo-buildpacks/update/pipeline
Browse files Browse the repository at this point in the history
Bump pipeline from 1.10.5 to 1.10.5
  • Loading branch information
Daniel Mikusa authored Sep 21, 2021
2 parents 51f929c + cde0cd6 commit 5a695c7
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/create-action-ibm-semeru-dependency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Create Action ibm-semeru-dependency
"on":
pull_request:
paths:
- actions/*
- actions/ibm-semeru-dependency/*
push:
branches:
- main
paths:
- actions/*
- actions/ibm-semeru-dependency/*
release:
types:
- published
jobs:
create-action:
name: Create Action
runs-on:
- ubuntu-latest
steps:
- if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
name: Docker login ghcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.JAVA_GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ secrets.JAVA_GITHUB_USERNAME }}
- uses: actions/checkout@v2
- id: version
name: Compute Version
run: |
#!/usr/bin/env bash
set -euo pipefail
if [[ ${GITHUB_REF} =~ refs/tags/v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
VERSION=${BASH_REMATCH[1]}
elif [[ ${GITHUB_REF} =~ refs/heads/(.+) ]]; then
VERSION=${BASH_REMATCH[1]}
else
VERSION=$(git rev-parse --short HEAD)
fi
echo "::set-output name=version::${VERSION}"
echo "Selected ${VERSION} from
* ref: ${GITHUB_REF}
* sha: ${GITHUB_SHA}
"
- name: Create Action
run: |
#!/usr/bin/env bash
set -euo pipefail
echo "::group::Building ${TARGET}:${VERSION}"
docker build \
--file actions/Dockerfile \
--build-arg "SOURCE=${SOURCE}" \
--tag "${TARGET}:${VERSION}" \
.
echo "::endgroup::"
if [[ "${PUSH}" == "true" ]]; then
echo "::group::Pushing ${TARGET}:${VERSION}"
docker push "${TARGET}:${VERSION}"
echo "::endgroup::"
else
echo "Skipping push"
fi
env:
PUSH: ${{ github.event_name != 'pull_request' }}
SOURCE: ibm-semeru-dependency
TARGET: ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency
VERSION: ${{ steps.version.outputs.version }}

0 comments on commit 5a695c7

Please sign in to comment.