-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.22 KB
/
main.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
name: Build Docker Image
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
tag:
description: 'Tag to build'
required: true
type: choice
default: '0.5.0'
options:
- '0.5.0'
permissions:
packages: write
contents: read
env:
REGISTRY: ghcr.io
IMAGE: ghcr.io/${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clone source repo
run: |-
git clone https://github.com/twitter/twemproxy.git
cd twemproxy
git checkout --detach refs/tags/${{ inputs.tag }}
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build base image
working-directory: ./twemproxy
run: make -f ../Makefile build IMAGE_NAME=nutcracker IMAGE_TAG=${{ inputs.tag }}
- name: Build final image
run: make build IMAGE_NAME=${{ env.IMAGE }} IMAGE_TAG=${{ inputs.tag }} ARGS="--build-arg BUILDER=nutcracker:${{ inputs.tag }}"
- name: Push docker image
run: make push IMAGE_NAME=${{ env.IMAGE }} IMAGE_TAG=${{ inputs.tag }}