Skip to content

Add pre-commit workflow, remove gitlab-ci.yml #16

Add pre-commit workflow, remove gitlab-ci.yml

Add pre-commit workflow, remove gitlab-ci.yml #16

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
jobs:
pre-commit:
runs-on: self-hosted
steps:
- name: Run pre-commit
run: |
pip install pre-commit
pre-commit install-hooks
pre-commit run -a --color=always --show-diff-on-failure
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/tags/}}| 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/tags/}}| 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