πͺ Manual build #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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@v5 | |
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 |