Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Action registry-request-yank-entry | |
"on": | |
pull_request: | |
paths: | |
- internal/** | |
- registry/internal/** | |
- registry/request-yank-entry/** | |
push: | |
branches: | |
- main | |
- test | |
paths: | |
- internal/** | |
- registry/internal/** | |
- registry/request-yank-entry/** | |
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 }} | |
name: Docker login ghcr.io | |
uses: docker/[email protected] | |
with: | |
password: ${{ secrets.IMPLEMENTATION_GITHUB_TOKEN }} | |
registry: ghcr.io | |
username: ${{ secrets.IMPLEMENTATION_GITHUB_USERNAME }} | |
- uses: actions/[email protected] | |
- 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 "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
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 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: registry/request-yank-entry/cmd | |
TARGET: ghcr.io/buildpacks/actions/registry/request-yank-entry | |
VERSION: ${{ steps.version.outputs.version }} |