-
Notifications
You must be signed in to change notification settings - Fork 211
64 lines (57 loc) · 1.79 KB
/
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
# Generate latest build and push it to dockerhub on push to develop branch.
# NOTE: This workflow does not include any tests, nor any dependencies, since bors guarantees
# that only code that passes all tests is ever pushed to develop.
name: Push to Dockerhub
run-name: Pushing ${{ github.ref_name }} to Dockerhub
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
on:
push:
branches:
- develop
tags:
- '*'
workflow_dispatch:
inputs:
custom_image_tag:
description: 'A custom image tag'
default: ''
jobs:
dockerpush:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }}
- uses: extractions/netrc@v2
with:
machine: github.com
username: ${{ secrets.GH_ACTION_TOKEN_USER }}
password: ${{ secrets.GH_ACTION_TOKEN }}
if: vars.GOPRIVATE
- name: Build docker images
run: |
export VERSION="${{ github.ref_name }}"
make dockerbuild-go
make dockerbuild-bs
- name: Push docker images to dockerhub
run: |
make dockerpush-only
make dockerpush-bs-only
- name: Push docker images to dockerhub
if: inputs.custom_image_tag
run: |
export DOCKER_IMAGE_VERSION="${{ inputs.custom_image_tag }}"
make dockerpush-only
make dockerpush-bs-only
- name: Push docker images with version tag to dockerhub
if: startsWith(github.ref, 'refs/tags/')
run: |
export DOCKER_IMAGE_VERSION="${{ github.ref_name }}"
make dockerpush-only
make dockerpush-bs-only
export DOCKER_IMAGE_REPO="go-spacemesh"
make dockerpush-only
make dockerpush-bs-only