-
Notifications
You must be signed in to change notification settings - Fork 15
57 lines (50 loc) · 1.68 KB
/
build-docker.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
name: Build and Push Docker Image
run-name: Build & Push - ${{ inputs.sourcetag }}:${{ inputs.userid }} from ${{ inputs.folder }}
on:
workflow_dispatch:
inputs:
sourcetag:
description: 'Tag for the Docker image'
required: true
default: 'latest'
userid:
description: 'UserID for docker image'
required: true
default: '1000'
folder:
description: 'Path to the Dockerfile'
required: true
type: choice
options:
- env0/custom-image/spectral-image
- env0/custom-image/alternative
- env0/custom-image
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: away168
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to away168
uses: docker/build-push-action@v6
with:
context: ${{ github.event.inputs.folder }}
build-args: |
BASE_TAG=${{ github.event.inputs.sourcetag }}
USER_ID=${{ github.event.inputs.userid }}
push: true
tags: |
away168/deployment-agent:${{ github.event.inputs.sourcetag }}-${{github.event.inputs.userid}}
cache-from: type=registry,ref=away168/deployment-agent:${{ github.event.inputs.sourcetag }}-${{github.event.inputs.userid}}
cache-to: type=inline
- name: Log out from Docker Hub
run: docker logout