forked from dingodb/dingo
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 2.15 KB
/
release-github.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
65
66
67
68
69
70
71
72
73
74
75
# This is a basic workflow to help you get started with Actions
name: Release-Github
# 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: ["Build"]
types:
- completed
on:
branches:
- develop
- main
pull_requests:
- merged
env:
IMAGE_NAME: dingo-ubuntu
# 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 represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
# Build Docker Image
- name: Dump GitHub context
id: github_context_step
run: echo '${{ toJSON(github) }}'
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build.yml
name: dingo.zip
- name: rename artifactory name
run: |
cp dingo.zip ./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:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_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: ghcr.io/dingodb/dingo:latest
# build on feature branches, push only on develop/main branch
push: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}