Merge pull request #4 from amp-buildpacks/feat/issue-3 #1
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: Push Builder Image | |
# on: | |
# release: | |
# types: | |
# - published | |
on: | |
push: | |
tags: | |
- v[0-9]+.* | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
push: | |
name: Push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Parse Event | |
id: event | |
run: | | |
echo "tag=$(jq -r '.release.tag_name' "${GITHUB_EVENT_PATH}" | sed s/^v//)" >> "$GITHUB_OUTPUT" | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get pack version | |
id: pack-version | |
run: | | |
version=$(jq -r .pack "scripts/.util/tools.json") | |
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: Create Builder Image | |
run: | | |
pack builder create builder --config builder.toml | |
- name: Set environment variable | |
run: echo "IMAGE_NAME=ghcr.io/amp-buildpacks/leo-builder" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.IMAGE_NAME }} | |
- name: Build and push by digest | |
id: build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true | |
provenance: false | |
cache-from: type=gha | |
cache-to: type=gha |