This is an automated email from the ASF dual-hosted git repository.

weibin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-graphar.git


The following commit(s) were added to refs/heads/main by this push:
     new 28edb931 chore(infra): Add workflow to publish docker image to ghcr.io 
(#565)
28edb931 is described below

commit 28edb931f897ae3465501e94bba900b876c7b0d9
Author: Weibin Zeng <[email protected]>
AuthorDate: Wed Jul 31 10:24:11 2024 +0800

    chore(infra): Add workflow to publish docker image to ghcr.io (#565)
    
    
    Signed-off-by: acezen <[email protected]>
---
 .../{graphar-dev.Dockerfile => Dockerfile}         | 17 +++++++
 .devcontainer/Makefile                             | 36 +++++++++++++++
 .github/workflows/publish-docker.yml               | 53 ++++++++++++++++++++++
 3 files changed, 106 insertions(+)

diff --git a/.devcontainer/graphar-dev.Dockerfile b/.devcontainer/Dockerfile
similarity index 72%
rename from .devcontainer/graphar-dev.Dockerfile
rename to .devcontainer/Dockerfile
index 1c910d6f..a2963fe8 100644
--- a/.devcontainer/graphar-dev.Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 FROM ubuntu:22.04
 
 ENV DEBIAN_FRONTEND=noninteractive
diff --git a/.devcontainer/Makefile b/.devcontainer/Makefile
new file mode 100644
index 00000000..ed34910c
--- /dev/null
+++ b/.devcontainer/Makefile
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+REGISTRY ?= docker.io/apache
+REPO ?= graphar-dev
+VERSION ?= latest
+
+.PHONY: docker-build
+docker-build:
+       docker build . -t $(REGISTRY)/$(REPO):$(VERSION) -t 
$(REGISTRY)/$(REPO):latest
+
+.PHONY: docker-push
+docker-push:
+       @{\
+               docker buildx create --use --driver docker-container --name 
graphar-dev ;\
+               docker buildx build --push -t $(REGISTRY)/$(REPO):$(VERSION) -t 
$(REGISTRY)/$(REPO):latest . ;\
+               build_exit_code=$$? ;\
+               docker buildx rm graphar-dev ;\
+               exit $$build_exit_code;\
+       }
+
+docker-release: docker-build docker-push
diff --git a/.github/workflows/publish-docker.yml 
b/.github/workflows/publish-docker.yml
new file mode 100644
index 00000000..e72629e1
--- /dev/null
+++ b/.github/workflows/publish-docker.yml
@@ -0,0 +1,53 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: publish-docker
+
+on: workflow_dispatch
+
+
+concurrency:
+  group: ${{ github.repository }}-${{ github.event.number || github.head_ref 
|| github.sha }}-${{ github.workflow }}
+  cancel-in-progress: true
+
+env:
+  REGISTRY: ghcr.io/apache
+
+jobs:
+  build:
+    if: github.repository == 'apache/incubator-graphar'
+    runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      packages: write
+    timeout-minutes: 30
+    env:
+      VERSION: ${{ github.sha }}
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Log in to the Container registry
+        uses: docker/[email protected]
+        with:
+          registry: ${{ env.REGISTRY }}
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
+      - name: Build and push docker image
+        working-directory: ".devcontainer"
+        run: |
+          make docker-release


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to