Skip to content

Commit

Permalink
Create builddocker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
beniroquai committed Oct 21, 2024
1 parent 43075a3 commit ccaa8fb
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/actions/setup/builddocker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: cubelab-docker

on:
workflow_dispatch:
push:

env:
REGISTRY: ghcr.io
IMAGE_NAME: openuc2/CubeLab

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

steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 2

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

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

- name: Log in to GitHub container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Set architecture to lowercase
run: echo "ARCH=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Print Dockerfile
run: cat dockerfile

- name: Build and push container image to registry
uses: docker/build-push-action@v2
with: #sudo docker build --file ./docker/manyfold.dockerfile --build-arg APP_VERSION=test --build-arg GIT_SHA=00 --tag cubelab .
context: docker
file: ./docker/manyfold.dockerfile
push: true
platforms: linux/amd64
cache-from: type=registry,ref=ghcr.io/${{ env.IMAGE_NAME }}-${{ env.ARCH }}:latest
cache-to: type=inline
build-args: |
APP_VERSION=test
GIT_SHA=00
tags: ghcr.io/${{ env.IMAGE_NAME }}-${{ env.ARCH }}:latest
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_DATE=${{ github.run_id }}

0 comments on commit ccaa8fb

Please sign in to comment.