Skip to content

Commit

Permalink
Merge pull request #127 from jgi-kbase/dev-add-build_ghcr
Browse files Browse the repository at this point in the history
Build GHCR images
  • Loading branch information
Xiangs18 authored Sep 5, 2024
2 parents 6dfadab + 48b62d8 commit f404814
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 79 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Docker

on:
workflow_dispatch:
push:
branches: [ "main", "master", "develop" ]
# Publish semver tags as releases.
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
pull_request:
branches: [ "main", "master", "develop" ]
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
11 changes: 0 additions & 11 deletions .github/workflows/manual-build.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/pr_build.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/release-main.yml

This file was deleted.

0 comments on commit f404814

Please sign in to comment.