Closed mhdawson closed 1 year ago
Depends on https://github.com/paketo-community/ubi-base-stack/pull/1 to land first.
This would be much harder to test in my local repository/docker namespace and is also much more straight forward of a copy of the existing actions used for other stacks.
The diff is as follows:
19a20,21
> echo "run_nodejs_16_download_url=$(jq -r '.release.assets[] | select(.name | endswith("run-nodejs-16.oci")) | .url' "${GITHUB_EVENT_PATH}")" >> "$GITHUB_OUTPUT"
> echo "run_nodejs_18_download_url=$(jq -r '.release.assets[] | select(.name | endswith("run-nodejs-18.oci")) | .url' "${GITHUB_EVENT_PATH}")" >> "$GITHUB_OUTPUT"
37a40,53
> - name: Download nodejs-16 Run Image
> uses: paketo-buildpacks/github-config/actions/release/download-asset@main
> with:
> url: ${{ steps.event.outputs.run_nodejs_16_download_url }}
> output: "/github/workspace/run-nodejs-16.oci"
> token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
>
> - name: Download nodejs-18 Run Image
> uses: paketo-buildpacks/github-config/actions/release/download-asset@main
> with:
> url: ${{ steps.event.outputs.run_nodejs_18_download_url }}
> output: "/github/workspace/run-nodejs-18.oci"
> token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
>
70,94c86,96
< # If the repository name contains 'bionic', let's push it to legacy image locations as well:
< # paketobuildpacks/{build/run}:{version}-{variant}
< # paketobuildpacks/{build/run}:{version}-{variant}-cnb
< # paketobuildpacks/{build/run}:{variant}-cnb
< # paketobuildpacks/{build/run}:{variant}
< registry_repo="${{ steps.registry-repo.outputs.name }}"
< if [[ ${registry_repo} == "bionic"-* ]];
< then
< # Strip the final part from a repo name after the `-`
< # bionic-tiny --> tiny
< variant="${registry_repo#bionic-}"
<
< sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/build.oci" "docker://${DOCKERHUB_ORG}/build:${{ steps.event.outputs.tag }}-${variant}"
< sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/build.oci" "docker://${DOCKERHUB_ORG}/build:${{ steps.event.outputs.tag }}-${variant}-cnb"
< sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/build.oci" "docker://${DOCKERHUB_ORG}/build:${variant}-cnb"
< sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/build.oci" "docker://${DOCKERHUB_ORG}/build:${variant}"
<
< sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run.oci" "docker://${DOCKERHUB_ORG}/run:${{ steps.event.outputs.tag }}-${variant}"
< sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run.oci" "docker://${DOCKERHUB_ORG}/run:${{ steps.event.outputs.tag }}-${variant}-cnb"
< sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run.oci" "docker://${DOCKERHUB_ORG}/run:${variant}-cnb"
< sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run.oci" "docker://${DOCKERHUB_ORG}/run:${variant}"
<
< sudo skopeo copy "docker://${DOCKERHUB_ORG}/build:${variant}-cnb" "docker://gcr.io/${GCR_PROJECT}/build:${variant}-cnb"
< sudo skopeo copy "docker://${DOCKERHUB_ORG}/run:${variant}-cnb" "docker://gcr.io/${GCR_PROJECT}/run:${variant}-cnb"
< fi
---
> sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run-nodejs-16.oci" "docker://${DOCKERHUB_ORG}/run-nodejs-16-${{ steps.registry-repo.outputs.name }}:${{ steps.event.outputs.tag }}"
> sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run-nodejs-16.oci" "docker://${DOCKERHUB_ORG}/run-nodejs-16-${{ steps.registry-repo.outputs.name }}:latest"
>
> sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run-nodejs-16.oci" "docker://gcr.io/${GCR_PROJECT}/run-nodejs-16-${{ steps.registry-repo.outputs.name }}:${{ steps.event.outputs.tag }}"
> sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run-nodejs-16.oci" "docker://gcr.io/${GCR_PROJECT}/run-nodejs-16-${{ steps.registry-repo.outputs.name }}:latest"
>
> sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run-nodejs-18.oci" "docker://${DOCKERHUB_ORG}/run-nodejs-18-${{ steps.registry-repo.outputs.name }}:${{ steps.event.outputs.tag }}"
> sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run-nodejs-18.oci" "docker://${DOCKERHUB_ORG}/run-nodejs-18-${{ steps.registry-repo.outputs.name }}:latest"
>
> sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run-nodejs-18.oci" "docker://gcr.io/${GCR_PROJECT}/run-nodejs-18-${{ steps.registry-repo.outputs.name }}:${{ steps.event.outputs.tag }}"
> sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/run-nodejs-18.oci" "docker://gcr.io/${GCR_PROJECT}/run-nodejs-18-${{ steps.registry-repo.outputs.name }}:latest"
[user1@fedora workflows]$
The additions are to add publishing the additional run images, and the removal was to remove check that only applied to ubuntu bionic
@sophiewigmore updated.
Summary
Add the workflow to publish docker images once a release is complete. Based on workflow used for existing stacks.
Use Cases
Needed as part of ubi-base-stack - more discussion in https://github.com/paketo-community/ubi-base-stack/issues/2
Checklist