Skip to content

Commit

Permalink
build: cleanup & improve release-docker-hub job (#385)
Browse files Browse the repository at this point in the history
Signed-off-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
  • Loading branch information
FabioPinheiro authored Nov 29, 2024
1 parent 5c8a038 commit 1bdc62a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 171 deletions.
88 changes: 0 additions & 88 deletions .github/workflows/build.yml

This file was deleted.

31 changes: 23 additions & 8 deletions .github/workflows/release-docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@ name: Release to Docker Hub
# updated: 2024/11/25
# How to test:
# > git tag v9.9.9
# > act --artifact-server-path /tmp/artifacts -s GITHUB_TOKEN="$(gh auth token)" --var DOCKERHUB_FMGP_USERNAME=$DOCKERHUB_FMGP_USERNAME -s DOCKERHUB_FMGP_TOKEN=$DOCKERHUB_FMGP_TOKEN --var DOCKERHUB_IDENTUS_USERNAME=$DOCKERHUB_IDENTUS_USERNAME -s DOCKERHUB_IDENTUS_TOKEN=$DOCKERHUB_IDENTUS_TOKEN -j build-and-push-docker-images schedule
# > git tag --delete v9.9.9
# > act --artifact-server-path /tmp/artifacts -s GITHUB_TOKEN="$(gh auth token)" --var DOCKERHUB_FMGP_USERNAME=$DOCKERHUB_FMGP_USERNAME -s DOCKERHUB_FMGP_TOKEN=$DOCKERHUB_FMGP_TOKEN --var DOCKERHUB_IDENTUS_USERNAME=$DOCKERHUB_IDENTUS_USERNAME -s DOCKERHUB_IDENTUS_TOKEN=$DOCKERHUB_IDENTUS_TOKEN -j build-and-push-docker-images schedule
# > act --artifact-server-path /tmp/artifacts -s GITHUB_TOKEN="$(gh auth token)" --var DOCKERHUB_FMGP_USERNAME=$DOCKERHUB_FMGP_USERNAME -s DOCKERHUB_FMGP_TOKEN=$DOCKERHUB_FMGP_TOKEN --var DOCKERHUB_IDENTUS_USERNAME=$DOCKERHUB_IDENTUS_USERNAME -s DOCKERHUB_IDENTUS_TOKEN=$DOCKERHUB_IDENTUS_TOKEN --workflows '.github/workflows/release-docker-hub.yml' push
# > act --artifact-server-path /tmp/artifacts -s GITHUB_TOKEN="$(gh auth token)" \
# --var DOCKERHUB_FMGP_USERNAME=$DOCKERHUB_FMGP_USERNAME -s DOCKERHUB_FMGP_TOKEN=$DOCKERHUB_FMGP_TOKEN \
# --var DOCKERHUB_IDENTUS_USERNAME=$DOCKERHUB_IDENTUS_USERNAME -s DOCKERHUB_IDENTUS_TOKEN=$DOCKERHUB_IDENTUS_TOKEN \
# workflow_dispatch --workflows '.github/workflows/release-docker-hub.yml' --eventpath \
# <( jq -n '{ inputs: { DEPLOYMENT_BRANCH: "v1.0.0" } }' )

# How to push old images from another repo:
# > docker login docker.io -u fmgp -p $DOCKERHUB_FMGP_TOKEN
# > docker login docker.io -u identus -p $DOCKERHUB_IDENTUS_TOKEN
# > OLD_TAG=ghcr.io/hyperledger/identus-mediator:1.0.0; NEW_TAG=docker.io/identus/identus-mediator:1.0.0; docker buildx imagetools create --tag "$NEW_TAG" "$OLD_TAG"



concurrency:
group: release
Expand All @@ -16,6 +29,8 @@ on:
push:
tags:
- v*
branches:
- 'main'

permissions:
contents: read
Expand Down Expand Up @@ -46,6 +61,9 @@ jobs:
with:
node-version: "lts/*"

- name: Setup Scala.JS
uses: japgolly/setup-scalajs@v1

- name: Build Binaries
env:
NODE_OPTIONS: --openssl-legacy-provider
Expand All @@ -56,8 +74,7 @@ jobs:
with:
name: docker-directory-artifact
path: ./mediator/target/docker/stage



build-and-push-docker-images:
name: Build and Push Docker images
runs-on: ubuntu-latest
Expand All @@ -73,8 +90,9 @@ jobs:
password_name: DOCKERHUB_IDENTUS_TOKEN
tags_noschedule: |
type=semver,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
# type=raw,value=${{needs.pick-build-version.outputs.build_version}}
type=sha,format=long
type=edge,branch=main
type=raw,value=latest,enable=${{ !startsWith(github.ref, 'refs/tags/v') }}
tags_schedule: |
type=schedule,pattern=nightly,enable={{is_default_branch}}
- # fmgp # My presonal acount also for testing
Expand All @@ -94,11 +112,8 @@ jobs:
echo "META_CONFIG<<EOF" >> $GITHUB_ENV
if [ ${{ github.event_name }} == 'schedule' ]; then
echo "${{matrix.docker.tags_schedule}}" >> $GITHUB_ENV;
# type=semver,pattern={{version}}
# type=sha,prefix={{branch}}-
else
echo "${{matrix.docker.tags_noschedule}}" >> $GITHUB_ENV;
# type=schedule,pattern={{date 'YYYYMMDD'}}
fi
echo "EOF" >> $GITHUB_ENV
Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit 1bdc62a

Please sign in to comment.