From c3712abaaf02151382125949405b08175e35226b Mon Sep 17 00:00:00 2001 From: phact Date: Mon, 9 Mar 2020 17:18:23 -0400 Subject: [PATCH] action --- .github/workflows/dockerhub.yml | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/dockerhub.yml diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml new file mode 100644 index 000000000..cd868ed8f --- /dev/null +++ b/.github/workflows/dockerhub.yml @@ -0,0 +1,34 @@ +# This is a basic workflow to help you get started with Actions + +name: dockerhub + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'nosqlbench-*' # Push events to matching nosqlbench-[version] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + - name: Login to DockerHub Registry + run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin + - name: Get the version + id: vars + run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) + - name: Build the tagged Docker image + run: docker build . --file Dockerfile --tag nosqlbench/nosqlbench:${{steps.vars.outputs.tag}} + - name: Push the tagged Docker image + run: docker push nosqlbench/nosqlbench:${{steps.vars.outputs.tag}} + - name: Build the latest Docker image + run: docker build . --file Dockerfile --tag nosqlbench/nosqlbench:latest + - name: Push the latest Docker image + run: docker push nosqlbench/nosqlbench:latest