pack v0.30.0 #51
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: 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@v3 | |
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@v3 | |
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@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- uses: docker/setup-qemu-action@v2 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: buildpacks/github-actions/setup-tools@v5.3.1 | |
- 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 |