diff --git a/.github/workflows/publish-docker-images-tagged.yml b/.github/workflows/publish-docker-images-tagged.yml new file mode 100644 index 0000000000..016071a0ac --- /dev/null +++ b/.github/workflows/publish-docker-images-tagged.yml @@ -0,0 +1,27 @@ +name: Publish Docker images + +on: + # Trigger the workflow on push or pull request, + # but only for the master branch + push: + branches: + - publish-docker + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - id: pre-step + shell: bash + run: echo "release-version=$(TZ=UTC0 git show --quiet --date='format-local:%Y%m%d%H%M%S' --format="%cd" $GITHUB_SHA)-$(echo ${GITHUB_SHA:0:6})" >> $GITHUB_OUTPUT + + - name: Publish to Dockerhub Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: gobitfly/eth2-beaconchain-explorer + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + tags: "${{ steps.pre-step.outputs.release-version }}" +