-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (42 loc) · 1.46 KB
/
manual_build.yaml
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
# Manual Docker build
name: 🪛 Manual build
on:
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag'
required: true
default: 'latest'
build_description:
description: 'Build description'
jobs:
build_container:
name: 🐋 Build Docker image
runs-on: ubuntu-latest
environment:
name: test-release
url: https://hub.docker.com/r/michelealberti/data-lunch-app
steps:
- name: Print build info
run: |
echo "Image tag: ${{ github.event.inputs.tag }}"
echo "Description: ${{ github.event.inputs.build_description }}"
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/web/Dockerfile.web
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ vars.DOCKER_HUB_USERNAME }}/data-lunch-app:${{ github.event.inputs.tag }}
cache-from: type=registry,ref=${{ vars.DOCKER_HUB_USERNAME }}/data-lunch-app:buildcache
cache-to: type=registry,ref=${{ vars.DOCKER_HUB_USERNAME }}/data-lunch-app:buildcache,mode=max