Skip to content

container-building

container-building #6

name: container-building
on:
workflow_dispatch:
inputs:
container:
description: 'The container to buld'
required: true
type: choice
options:
- bundev
- godev
- nodedev
version:
description: 'The version of Go to build on top of'
required: true
type: string
os:
description: 'The operating system base to use, like alpine, and should start with a -'
required: false
type: string
default: ''
env:
VERSION: ${{ github.event.inputs.version }}
OS: ${{ github.event.inputs.os }}
jobs:
build-containers-ghcr:
runs-on: ubuntu-latest
steps:
- name: 'Checkout the code'
uses: actions/checkout@v2
- name: 'Log into GHCR'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Extract metadata (tags, labels) for the container.'
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/bzvestey/${{ inputs.container }}
tags: |
${{ env.VERSION }}${{ env.OS }}
latest
- name: 'Build and Push the container.'
uses: docker/build-push-action@v2
with:
context: ./${{ inputs.container }}
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
version=${{ env.VERSION }}
os=${{ env.OS }}