Skip to content

Release-Dockerhub

Release-Dockerhub #243

# This is a basic workflow to help you get started with Actions
name: Release-Dockerhub
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
workflow_run:
workflows: ["CMake_rocky"]
types:
- completed
on:
branches:
- develop
- main
pull_requests:
- merged
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
# The type of runner that the job will run on
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: ci_rocky.yml
name: dingo-store.tar.gz
- name: rename artifactory name
run: |
cp dingo-store.tar.gz ./docker
# setup Docker buld action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Packages
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image and push to Docker Hub and GitHub Container Registry
uses: docker/build-push-action@v2
with:
# relative path to the place where source code with Dockerfile is located
context: ./docker
# Note: tags has to be all lower-case
tags: dingodatabase/dingo-store:latest
# build on feature branches, push only on develop branch
push: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}