Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/container-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

name: Build Docker image

on:
workflow_dispatch:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]

jobs:
build-docker-image:
if: github.repository_owner == 'LCAS'
runs-on:
- lcas
- qemu
steps:
- name: Node Js
uses: actions/setup-node@v4

- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: 'recursive'

- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Docker Login LCAS
uses: docker/login-action@v3
with:
registry: lcas.lincoln.ac.uk
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}

- name: "image name from repo name"
id: docker_image_name
run: echo "docker_image=${{ github.repository }}" | tr '[:upper:]' '[:lower:]' |sed 's/[^0-9,a-z,A-Z,=,_,\/]/-/g' >>${GITHUB_OUTPUT}

- name: Docker meta
id: meta_public
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: lcas.lincoln.ac.uk/${{ steps.docker_image_name.outputs.docker_image }}
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=staging
type=raw,value=latest,enable={{is_default_branch}}
type=ref,enable=${{ github.event_name != 'pull_request' }},event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}

- name: Build Public Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: .devcontainer/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=registry,ref=lcas.lincoln.ac.uk/cache/${{ steps.docker_image_name.outputs.docker_image }}:latest
cache-to: type=registry,ref=lcas.lincoln.ac.uk/cache/${{ steps.docker_image_name.outputs.docker_image }}:latest,mode=max
tags: ${{ steps.meta_public.outputs.tags }}
labels: ${{ steps.meta_public.outputs.labels }}
build-args: |
BASE_IMAGE=lcas.lincoln.ac.uk/lcas/limo_platform:2.2
35 changes: 35 additions & 0 deletions .github/workflows/dev-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'devcontainer CI'
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
build:
runs-on: lcas
steps:
- name: Node Js
uses: actions/setup-node@v4
with:
node-version: "^16.13.0 || >=18.0.0"
- name: Checkout (GitHub)
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: 'recursive'
- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: "image name from repo name"
id: docker_image_name
run: echo "docker_image=${{ github.repository }}" | tr '[:upper:]' '[:lower:]' |sed 's/[^0-9,a-z,A-Z,=,_,\/]/-/g' >>${GITHUB_OUTPUT}
- name: Build container
uses: devcontainers/ci@v0.3
with:
imageName: lcas.lincoln.ac.uk/devcontainer/${{ steps.docker_image_name.outputs.docker_image }}
push: never
imageTag: ci
#runCmd: "bash .devcontainer/run-ci.sh"
Loading