Skip to content

build weekly prod container #71

build weekly prod container

build weekly prod container #71

name: build weekly prod container
on:
schedule:
- cron: "14 14 * * 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
jobs:
build-prod:
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: resources/containers/
file: resources/containers/containerfile.min
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}