forked from manyfold3d/manyfold
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43075a3
commit ccaa8fb
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |