Skip to content

Build & Push

Build & Push #68

Workflow file for this run

name: Build & Push
on:
workflow_dispatch:
inputs:
image:
description: 'Image to build'
required: true
type: choice
options:
- datascience
- metatrader
- phpdev
- pywine
- wine
invalid_cache:
description: 'Invalid the cache for this build'
required: false
default: false
type: boolean
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
-
name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v2
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Set cache invalidation flag
id: set_invalid_cache_flag
run: |
echo "invalid_cache=$(if ${{ inputs.invalid_cache }} ; then echo 'NO_CACHE=1'; fi)" >> $GITHUB_OUTPUT
-
name: Build
run: |
make -C specs/${{ inputs.image }} \
${{ steps.set_invalid_cache_flag.outputs.invalid_cache }}
-
name: Push
run: |
make -C specs/${{ inputs.image }} push