Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GithubAction] Push Operator Node Images #51

Merged
merged 5 commits into from
Nov 20, 2023
Merged
Changes from 2 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
84 changes: 84 additions & 0 deletions .github/workflows/docker-publish-opr-node-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Push Docker images to GHCR with Caching

on:
workflow_dispatch:
inputs:
commit_sha:
description: 'Specific Commit SHA (Required)'
required: true
release_tag:
description: 'Release Tag (Optional)'
required: false
default: ''

env:
REGISTRY: ghcr.io

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository at specified commit
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.commit_sha }}

- name: Setup Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
driver-opts: image=moby/buildkit:master

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.event.inputs.commit_sha }}
restore-keys: |
${{ runner.os }}-buildx-
if: ${{ success() }}

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ success() }}

- name: Set Tag Name
id: set_tag
run: echo "::set-output name=tag::${{ github.event.inputs.release_tag || github.event.inputs.commit_sha }}"
siddimore marked this conversation as resolved.
Show resolved Hide resolved
siddimore marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ success() }}

- name: Build and Push Opr Node Image
uses: docker/build-push-action@v2
with:
file: ./node/cmd/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/layr-labs/eigenda/opr-node:${{ github.event.inputs.commit_sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
siddimore marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ success() }}

- name: Build and Push NodePlugin Image
uses: docker/build-push-action@v2
with:
context: .
file: ./node/plugin/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/layr-labs/eigenda/opr-nodeplugin:${{ github.event.inputs.commit_sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
if: ${{ success() }}

- name: Update cache
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache-new
key: ${{ runner.os }}-buildx-${{ github.event.inputs.commit_sha }}
restore-keys: |
${{ runner.os }}-buildx-
Loading