Skip to content

Commit

Permalink
Replace docker.sh script with GitHub Actions
Browse files Browse the repository at this point in the history
der-eismann authored and vladak committed Jul 13, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 3a89933 commit a47e52c
Showing 2 changed files with 24 additions and 104 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ name: Build Docker image
on: [push, pull_request]

jobs:
ubuntu:
container:
runs-on: ubuntu-latest
steps:
- name: Checkout master branch
@@ -26,14 +26,30 @@ jobs:
run: black --check docker/*.py
- name: Run isort in check mode
run: isort --settings-file docker/.isort.cfg docker/*.py --check --diff
- name: Running linter
run: docker run --rm -i hadolint/hadolint:2.6.0 < Dockerfile || exit 1
- name: Docker metadata generation
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to Docker Hub
if: ${{ github.repository == 'oracle/opengrok' && github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and optionally push Docker image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
OPENGROK_REPO_SLUG: ${{ github.repository }}
OPENGROK_PULL_REQUEST: ${{ github.head_ref }}
OPENGROK_REF: ${{ github.ref }}
run: ./dev/docker.sh
uses: docker/build-push-action@v4
with:
push: ${{ github.repository == 'oracle/opengrok' && github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
- name: Install Python pre-requisites
run: python3 -m pip install requests
- name: Optionally update README on Docker hub
96 changes: 0 additions & 96 deletions dev/docker.sh

This file was deleted.

0 comments on commit a47e52c

Please sign in to comment.