Skip to content

test2

test2 #424

Workflow file for this run

name: BuildAndPublish
on:
pull_request:
push:
branches:
- master
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5
jobs:
build-images:
name: Build Images
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v1
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=bianjie/irita
VERSION=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
[ "${{ github.event.repository.default_branch }}" = "$VERSION" ] && VERSION=latest
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
# Login so we can push the image
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
# Using the github action, push the IRISHub amd64/arm64 image to Docker Hub
- name: Publish to Docker Hub
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.prep.outputs.tags }}