Skip to content

.github/workflows/release.yml #21

.github/workflows/release.yml

.github/workflows/release.yml #21

Workflow file for this run

on:
release:
types: [published]
env:
GITHUB_ACTION_TAG: ${{ github.ref_name }}
jobs:
build-amd64-digest:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
outputs:
digest: ${{ steps.digest.outputs.digest }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set the ENV values
id: get-Envs
run: |
echo "$(make -s log | grep TAG)" >> "$GITHUB_ENV"
echo "$(make -s log | grep ARCH)" >> "$GITHUB_ENV"
echo "$(make -s log | grep REGISTRY_IMAGE)" >> "$GITHUB_ENV"
- name: Print ENV values
id: print_Envs
run: |
echo "$GITHUB_ENV"
- name: Docker meta
id: meta-amd64
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: "Read secrets"
run: |
echo "DOCKER_USERNAME=mgfritch" >> $GITHUB_ENV
echo "DOCKER_PASSWORD=${{ secrets.DOCKER_PASSWORD }}" >> $GITHUB_ENV
echo "PRIME_REGISTRY_USERNAME=mgfritch" >> $GITHUB_ENV
echo "PRIME_REGISTRY_PASSWORD=${{ secrets.PRIME_REGISTRY_PASSWORD }}" >> $GITHUB_ENV
echo "PUBLIC_REGISTRY=ghcr.io" >> $GITHUB_ENV
echo "PRIME_REGISTRY=ghcr.io" >> $GITHUB_ENV
- name: Build and push container image
id: build-amd64
uses: rancher/ecm-distro-tools/actions/publish-image@master
env:
META_LABELS: ${{ steps.meta-amd64.outputs.labels }}
with:
image: hardened-calico
tag: ${{ github.event.release.tag_name }}
platforms: linux/amd64
public-repo: mgfritch
public-registry: ${{ env.PUBLIC_REGISTRY }}
public-username: ${{ env.DOCKER_USERNAME }}
public-password: ${{ secrets.DOCKER_PASSWORD }}
prime-repo: mgfritch
prime-registry: ${{ env.PRIME_REGISTRY }}
prime-username: ${{ env.PRIME_REGISTRY_USERNAME }}
prime-password: ${{ secrets.PRIME_REGISTRY_PASSWORD }}
- name: Digest
id: digest
run: |
IMAGE_DIGEST=$(jq -r '.["containerimage.digest"]' /tmp/metadata.json)
echo "digest=$IMAGE_DIGEST" >> "$GITHUB_OUTPUT"