Merge pull request #535 from ipfs-force-community/chore/bump-v2.12.0 #334
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 Image CI | |
on: | |
push: | |
branches: ['prep/**', 'release/**', 'test/**', master] | |
tags: ['**'] | |
jobs: | |
# build_docker_image: | |
# uses: filecoin-project/venus/.github/workflows/common_docker_image.yml@master | |
# secrets: | |
# DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | |
# todo: replace this job with action from venus | |
build_docker_image: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create vars | |
id: vars | |
run: | | |
export github_tag=${{ github.ref_name }} | |
export repo_name=${GITHUB_REPOSITORY##*/} | |
export is_tag_create=false | |
export docker_user_name='filvenus' | |
export rx_tag='^refs\/tags\/.*' | |
export rx_version_tag='^v([0-9]+\.){0,2}(\*|[0-9]+)(-rc[0-9]*){0,1}$' | |
if [[ "${{github.ref}}" =~ $rx_tag ]]; then | |
export is_tag_create=true | |
fi | |
echo "::set-output name=github_tag::$github_tag" | |
echo "::set-output name=repo_name::$repo_name" | |
echo "::set-output name=is_tag_create::$is_tag_create" | |
echo "::set-output name=docker_user_name::$docker_user_name" | |
- name: Show environment | |
run: | | |
echo is_tag_create = ${{ steps.vars.outputs.is_tag_create }} | |
echo github_tag = ${{ steps.vars.outputs.github_tag }} | |
echo repo_name = ${{ steps.vars.outputs.repo_name }} | |
echo docker_user_name = ${{steps.vars.outputs.docker_user_name}} | |
echo docker_password = ${{secrets.DOCKER_PASSWORD}} | |
- name: Build the Docker image | |
if: ${{ steps.vars.outputs.is_tag_create == 'true' }} | |
run: | | |
docker login --username=${{steps.vars.outputs.docker_user_name}} --password ${{ secrets.DOCKER_PASSWORD }} | |
make docker-push TAG=${{ steps.vars.outputs.github_tag }} |