Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 0 additions & 76 deletions .github/action_templates/build-and-push/action.yaml

This file was deleted.

94 changes: 0 additions & 94 deletions .github/action_templates/build-and-test/action.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/action_templates/slack/action.yaml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/actions/docker-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: 'Docker Build and Push'
description: 'Build and push Docker images with Slack notification'

inputs:
dockerfile-tag:
description: 'Tag to replace in Dockerfile'
required: true
docker-tags:
description: 'Newline-separated list of Docker tags'
required: true
slack-title:
description: 'Title for Slack notification'
required: true
dockerhub-username:
description: 'DockerHub username'
required: true
dockerhub-token:
description: 'DockerHub token'
required: true
buildcloud-endpoint:
description: 'Buildcloud endpoint'
required: true
slack-webhook-url:
description: 'Slack webhook URL'
required: true

runs:
using: "composite"
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ inputs.dockerhub-username }}
password: ${{ inputs.dockerhub-token }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: "lab:latest"
driver: cloud
endpoint: ${{ inputs.buildcloud-endpoint }}

- name: Update Dockerfile
shell: bash
run: sed -i "s/@ngiab_dev/@ngiab_$(echo ${{ inputs.dockerfile-tag }} | sed 's/\./\\./g')/g" ./docker/Dockerfile

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./docker
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ inputs.docker-tags }}

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: ngen-github-ci
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://avatars.githubusercontent.com/u/119541160?s=48&v=4
SLACK_TITLE: ${{ inputs.slack-title }}
SLACK_USERNAME: Github Action Result
SLACK_WEBHOOK: ${{ inputs.slack-webhook-url }}
27 changes: 27 additions & 0 deletions .github/workflows/docker_build_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Pull Request Test Image

on:
pull_request:
branches: [ main ]
paths:
- docker/**

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2

- name: Build and Push Docker
uses: ./.github/actions/docker-build
with:
dockerfile-tag: ${{ github.event.pull_request.number }}
docker-tags: |
${{ secrets.DOCKERHUB_USERNAME }}/ciroh-ngen-image-dev:${{ github.event.pull_request.number }}
${{ secrets.DOCKERHUB_USERNAME }}/ngiab-dev:${{ github.event.pull_request.number }}
slack-title: Pull request built ${{ github.event.pull_request.title }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
buildcloud-endpoint: ${{ secrets.BUILDCLOUD_ENDPOINT }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
Loading