55 lines
1.5 KiB
YAML
55 lines
1.5 KiB
YAML
name: Container Build
|
|
|
|
env:
|
|
# 🖊️ EDIT to change the image registry settings.
|
|
# Registries such as GHCR, Quay.io, and Docker Hub are supported.
|
|
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
|
|
IMAGE_REGISTRY_USER: ${{ github.actor }}
|
|
IMAGE_REGISTRY_PASSWORD: ${{ github.token }}
|
|
|
|
# 🖊️ EDIT to specify custom tags for the container image, or default tags will be generated below.
|
|
IMAGE_TAGS: ""
|
|
|
|
on:
|
|
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
container-build:
|
|
name: Build and deploy to OpenShift
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Determine timestamp
|
|
id: time
|
|
uses: nanzm/get-time-action@v1.1
|
|
with:
|
|
format: 'YYYYMMDDHHmm' # Minute granularity timestamp for versioning
|
|
|
|
- name: Build from Containerfile
|
|
id: build-image
|
|
uses: redhat-actions/buildah-build@v2
|
|
with:
|
|
image: homepage
|
|
tags: ${{ steps.time.outputs.time }} latest
|
|
containerfiles: |
|
|
./Containerfile
|
|
|
|
- name: Push to registry
|
|
id: push-image
|
|
uses: redhat-actions/push-to-registry@v2
|
|
with:
|
|
image: ${{ steps.build-image.outputs.image }}
|
|
tags: ${{ steps.build-image.outputs.tags }}
|
|
registry: ${{ env.IMAGE_REGISTRY }}
|
|
username: ${{ env.IMAGE_REGISTRY_USER }}
|
|
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}
|