Skip to content

Commit

Permalink
Merge pull request #1 from epics-containers/github-switch
Browse files Browse the repository at this point in the history
switch template to github
  • Loading branch information
gilesknap authored Oct 11, 2024
2 parents 786f0f1 + de12dc7 commit 49fab63
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 81 deletions.
7 changes: 4 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
_commit: 4.0.1
_src_path: gh:epics-containers/ioc-template
description: A Generic IOC for andor3 cameras
git_platform: gitlab.diamond.ac.uk
name: ioc-andor3
repo_uri: [email protected]:controls/containers/iocs/ioc-andor3.git
git_platform: github.com
github_org: epics-containers
name: ioc-adandor3
repo_uri: [email protected]:epics-containers/ioc-adandor3
rtems: false
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Look for updates to python and docker dependencies.

version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
113 changes: 113 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Build and publish image to ghcr.io/epics-containers

on:
push:
pull_request:

jobs:
build:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
epics-target: [linux-x86_64] # , linux-aarch64]
include:
- os: ubuntu-latest # everyone is on ubuntu-latest
- epics-target: linux-x86_64
extension: ""
platform: linux/amd64

# # a temporary name until multi-arch is supported
# - epics-target: linux-aarch64
# extension: -native-aarch64
# platform: linux/arm64

runs-on: ${{ matrix.os }}
env:
TAG: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}${{ matrix.extension }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Build image
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
target: runtime
build-args: |
IMAGE_EXT=${{ matrix.extension }}
cache-from: type=gha,scope=${{ matrix.epics-target }}
cache-to: type=gha,mode=max,scope=${{ matrix.epics-target }}
tags: ci_test
load: true

- name: Test image
# can't test non native without some hardware to run on
if: ${{ matrix.epics-target == 'linux-x86_64' }}
run: tests/run-tests.sh ci_test

- name: Push developer image
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
target: developer
build-args: |
IMAGE_EXT=${{ matrix.extension }}
tags: ${{ env.TAG }}-developer:${{ github.ref_name }}
push: true

- name: Push runtime image
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
target: runtime
build-args: |
IMAGE_EXT=${{ matrix.extension }}
tags: ${{ env.TAG }}-runtime:${{ github.ref_name }}
push: true

release:
# Release on tag push - publish ioc schema
needs: [build]
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
runs-on: ubuntu-latest

# this job runs in the native developer container we just made
container:
image: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}-developer:${{ github.ref_name }}

steps:
- name: generate-schema
run: |
ibek ioc generate-schema --output ibek.ioc.schema.json
- name: Github Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: |
ibek.ioc.schema.json
generate_release_notes: true
47 changes: 0 additions & 47 deletions .gitlab-ci.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .gitlab/kanikobuild.sh

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generic IOC Template Repository ioc-andor3
# Generic IOC Template Repository ioc-adandor3

## Description
A Generic IOC for andor3 cameras
Expand All @@ -13,7 +13,7 @@ To update to the latest version of the template:
# activate a python virtual environment

pip install copier
cd ioc-andor3
cd ioc-adandor3
copier update -a --trust .
```

Expand Down

0 comments on commit 49fab63

Please sign in to comment.