-
Notifications
You must be signed in to change notification settings - Fork 15
55 lines (52 loc) · 1.83 KB
/
pb-create-action-cf-java-index-dependency.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Create Action cf-java-index-dependency
"on":
pull_request:
paths:
- actions/*
- actions/cf-java-index-dependency/*
push:
branches:
- main
paths:
- actions/*
- actions/cf-java-index-dependency/*
release:
types:
- published
jobs:
create-action:
name: Create Action
runs-on:
- ubuntu-latest
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ secrets.JAVA_GITHUB_USERNAME }}
- uses: actions/checkout@v3
- 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: cf-java-index-dependency
TARGET: ghcr.io/paketo-buildpacks/actions/cf-java-index-dependency
VERSION: main