Skip to content

Commit

Permalink
Add initial GHCR build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
d-mo committed Apr 22, 2024
1 parent ee7b0f1 commit 4cb8188
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]

jobs:
build_operator_image:
runs-on: self-hosted
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- uses: actions/checkout@v3
- name: Build the Docker image
run: |
if [[ $GITHUB_REF == 'refs/heads/main' ]]; then
TAG=latest
else
TAG=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}| tr / -)
fi
docker build . --file Dockerfile --tag ghcr.io/dell/remote-development-operator:$TAG
docker push ghcr.io/dell/remote-development-operator:$TAG
build_devenv_image:
runs-on: self-hosted
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- uses: actions/checkout@v3
- name: Build the Docker image
run: |
if [[ $GITHUB_REF == 'refs/heads/main' ]]; then
TAG=latest
else
TAG=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}| tr / -)
fi
docker build . --file Dockerfile --tag ghcr.io/dell/remote-development-operator/devenv:$TAG
docker push ghcr.io/dell/remote-development-operator/devenv:$TAG

0 comments on commit 4cb8188

Please sign in to comment.