Skip to content

HNX v2.3.4

HNX v2.3.4 #3

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
# This Workflow is based on GitHub's documentation at https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
name: Publish Docker image
on:
release:
types: [published]
workflow_dispatch:
inputs:
triggeredBy:
description: 'Name of team member who is manually triggering this workflow'
required: true
default: ''
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- if: ${{ inputs.triggeredBy != '' }}
run: |
echo "This workflow was triggered by: $TEAM_MEMBER"
env:
TEAM_MEMBER: ${{ inputs.triggeredBy }}
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
tags: hypernetx/hypernetx:latest
push: true
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: hypernetx/hypernetx
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true