Skip to content

pack v0.31.0

pack v0.31.0 #52

Workflow file for this run

name: delivery / docker
on:
release:
types:
- released
workflow_dispatch:
inputs:
tag_name:
description: The release tag to distribute
required: true
tag_latest:
description: Tag as latest
required: false
type: boolean
default: false
env:
BUILDER: "paketobuildpacks/builder-jammy-tiny"
IMG_NAME: 'pack'
USERNAME: 'buildpacksio'
jobs:
deliver-docker:
runs-on: ubuntu-latest
steps:
- name: Determine version
uses: actions/github-script@v6
id: version
with:
result-encoding: string
script: |
let tag = (context.payload.release && context.payload.release.tag_name)
|| (context.payload.inputs && context.payload.inputs.tag_name);
if (!tag) {
throw "ERROR: unable to determine tag";
}
return tag.replace(/^v/, '');
- name: Checkout source at tag
uses: actions/checkout@v4
with:
ref: v${{ steps.version.outputs.result }}
# This has to come after the first checkout, so it isn't clobbered
- name: Checkout delivery configuration
uses: actions/checkout@v4
with:
path: ./head
- name: Setup Working Dir
shell: bash
run: |
rm project.toml || true
cp head/.github/workflows/delivery/docker/project.toml project.toml
- name: Determine App Name
run: 'echo "IMG_NAME=${{ env.USERNAME }}/${{ env.IMG_NAME }}" >> $GITHUB_ENV'
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: buildpacks/github-actions/setup-tools@v5.4.0
- name: Buildx Build/Publish
run: |
docker buildx build . \
--tag ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }} \
--platform linux/amd64,linux/arm64 \
--build-arg pack_version=${{ steps.version.outputs.result }} \
--provenance=false \
--push
- name: Tag Image as Latest
if: ${{ github.event.release != '' || github.event.inputs.tag_latest }}
run: |
crane copy ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }} ${{ env.IMG_NAME }}:latest