Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions github-action-workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Source Code for the IBM Cloud Code Engine: Deploying Apps, Jobs and Functions using GitHub Actions Blog post

This folder contains the source code used in the [IBM Cloud Code Engine: Deploying Apps, Jobs and Functions using GitHub Actions](https://community.ibm.com/community/user/blogs/luke-roy/2024/02/12/ibm-cloud-code-engine-deploying-apps-jobs-and-func) Blog Post.
This folder contains the source code used in the [IBM Cloud Code Engine: Deploying Apps, Jobs and Functions using GitHub Actions](https://community.ibm.com/community/user/blogs/luke-roy/2024/02/12/ibm-cloud-code-engine-deploying-apps-jobs-and-func) and the [IBM Cloud Code Engine GitHub Action: Getting into the Cloud just got a lot easier!](https://community.ibm.com/community/user/blogs/luke-roy/2025/11/24/ibm-cloud-code-engine-github-action-easier) Blog Posts

- [App](github-action-workflows/my-ce-app)
- [App,Build](github-action-workflows/my-ce-app)
- [Docker App](github-action-workflows/my-docker-app)
- [Image App](github-action-workflows/my-img-app)
- [Python Function](github-action-workflows/my-ce-py-func)
25 changes: 25 additions & 0 deletions github-action-workflows/my-ce-app/build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and Push to ICR

on:
push:
branches:
- main

jobs:
app:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Build and Push to ICR
uses: ibm/code-engine-github-action@v1
with:
api-key: ${{ secrets.IBM_IAM_API_KEY }}
region: 'eu-de'
project: 'MY-PROJECT'
component: 'build'
name: 'my-ce-app'
image: private.de.icr.io/my-namespace/my-image:latest
registry-secret: ce-auto-icr-private-eu-de
build-source: './my-ce-app'
15 changes: 15 additions & 0 deletions github-action-workflows/my-docker-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM quay.io/projectquay/golang:1.24 AS build-env

WORKDIR /go/src/app

COPY main.go main.go

RUN CGO_ENABLED=0 go build -o /go/bin/app main.go

FROM gcr.io/distroless/static-debian12

EXPOSE 3000

COPY --from=build-env /go/bin/app /

ENTRYPOINT ["/app"]
30 changes: 30 additions & 0 deletions github-action-workflows/my-docker-app/build-dockerfile-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy App to Code Engine using Dockerfile build-strategy

on:
push:
branches:
- main
workflow_dispatch:

jobs:

deploy-app:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Deploy App to Code Engine using Dockerfile build-strategy
uses: IBM/code-engine-github-action@v1
with:
api-key: ${{ secrets.IBM_IAM_API_KEY }}
resource-group: 'Default'
region: 'eu-de'
project: 'MY-PROJECT'
component: 'app'
build-strategy: 'dockerfile'
port: 3000
name: 'my-docker-app'
build-source: './my-docker-app'
cpu: 1
memory: 4G
16 changes: 16 additions & 0 deletions github-action-workflows/my-docker-app/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import (
"fmt"
"net/http"
"time"
)

func greet(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello World! %s", time.Now())
}

func main() {
http.HandleFunc("/", greet)
http.ListenAndServe(":3000", nil)
}
28 changes: 28 additions & 0 deletions github-action-workflows/my-img-app/my-img-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy Application to Code Engine using existing container image

on:
push:
branches:
- main
workflow_dispatch:

jobs:

deploy-app:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Deploy Application to Code Engine using existing container image
uses: IBM/code-engine-github-action@v1
with:
api-key: ${{ secrets.IBM_IAM_API_KEY }}
resource-group: 'Default'
region: 'eu-de'
project: 'MY-PROJECT'
component: 'app'
name: 'my-img-app'
image: icr.io/codeengine/helloworld:latest
cpu: 1
memory: 4G