Skip to content

Build Docker Image

Build Docker Image #25

Workflow file for this run

name: Build Docker Image
on:
workflow_run:
workflows: [ "tests" ]
branches: [ main ]
types: [ "completed" ]
push:
branches:
- main
- workflow
- workflowhub
- seek-1.11
- seek-1.12
- seek-1.13
- master-ibisba-demonstrator
- ruby-3
pull_request:
jobs:
build:
name: "Build Image"
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- id: generate-image-tag
name: Generate Image Tag
env:
ref_name: "${{ github.ref_name }}"
head_ref: "${{ github.head_ref }}"
run: |
ref_name="${head_ref:-${ref_name/main/latest}}"
echo "::set-output name=imageTag::${ref_name#v}"
- name: Login to Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ steps.generate-image-tag.outputs.imageTag }}