fix CI: tag for push not set #10
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: docker_publish | |
on: | |
pull_request: | |
branches: | |
- 'feat/babylon-rfc' | |
push: | |
branches: | |
- 'feat/babylon-rfc' | |
tags: | |
- 'v*' | |
jobs: | |
docker_pipeline: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set the Docker image tag | |
id: set_docker_image_tag | |
run: | | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
else | |
echo "TAG=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
fi | |
- name: Build and push to Docker Hub | |
id: build-dockerhub | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
file: ./ops/docker/op-stack-go/Dockerfile | |
target: op-node-target | |
outputs: type=image,name=${{ vars.DOCKERHUB_REGISTRY_ID }}/op-node-babylon-finality-gadget:${{ steps.set_docker_image_tag.outputs.TAG }} | |