Chore tagging release images #83
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: build-scan | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- 'develop' | |
permissions: | |
contents: read | |
packages: write | |
security-events: write | |
jobs: | |
matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
node_types: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v2 | |
- id: set-matrix | |
run: | | |
echo "matrix=${{vars.NODE_TYPES}}" >> $GITHUB_OUTPUT | |
build: | |
needs: matrix | |
strategy: | |
matrix: | |
node: ${{ fromJson(needs.matrix.outputs.node_types) }} | |
uses: ./.github/workflows/node-build.yml | |
with: | |
REGISTRY: ${{ vars.REGISTRY }} | |
REPOSITORY: ${{ vars.REPOSITORY }} | |
NODE_TYPE: ${{ matrix.node }} | |
scan-image: | |
needs: [ matrix, build ] | |
strategy: | |
matrix: | |
node: ${{ fromJson(needs.matrix.outputs.node_types) }} | |
uses: aiblockofficial/workflows/.github/workflows/scan-image.yml@main | |
secrets: inherit | |
with: | |
IMAGE: ${{ vars.REGISTRY }}/${{ vars.ORGANISATION_NAME }}/node-${{ matrix.node }}:${{ github.sha }} | |
merge: | |
needs: [matrix, build, scan-image] | |
strategy: | |
matrix: | |
node: ${{ fromJson(needs.matrix.outputs.node_types) }} | |
runs-on: ubuntu-latest | |
env: | |
REGISTRY_IMAGE: ${{ vars.REGISTRY }}/aiblockofficial/node-${{ matrix.node }} | |
steps: | |
- name: Download digests | |
uses: actions/download-artifact@v4 | |
with: | |
path: /tmp/digests | |
pattern: digests-* | |
merge-multiple: true | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY_IMAGE }} | |
tags: | | |
type=raw,value=latest | |
type=sha | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ vars.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create manifest list and push | |
working-directory: /tmp/digests | |
run: | | |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) | |
- name: Inspect image | |
run: | | |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} |