Skip to content

build-base

build-base #93

name: build-base
on:
schedule:
- cron: "14 7 * * 0"
workflow_dispatch:
inputs:
build_anyway:
type: boolean
description: Allow the workflow to run when repo owner != lnxjedi
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/gopherbot-base
jobs:
build-and-push-container-base:
if: ( github.repository_owner == 'lnxjedi' ) || github.event.inputs.build_anyway
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@f75d088332b07a08afadf6ac53c74509b9453f12
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@314ddf6d4a82333bf1bc7630399df41bf68eba09
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@175d02bffea74695e96b351069ac938b338802f9
with:
context: .
file: resources/containers/containerfile.base
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}