forked from dingodb/dingo-store
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.92 KB
/
release-dockerhub.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 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@v4
- 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@v3
- name: Login to Github Packages
uses: docker/login-action@v3
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@v6
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 }}