github.com/kubevela/workflow@v0.6.0/examples/workflow-run/build-push-image.yaml (about)

     1  apiVersion: core.oam.dev/v1alpha1
     2  kind: WorkflowRun
     3  metadata:
     4    name: build-push-image
     5    namespace: default
     6  spec:
     7    workflowSpec:
     8     steps:
     9     # or use kubectl create secret generic git-token --from-literal='GIT_TOKEN=<your-token>'
    10      - name: create-git-secret
    11        type: export2secret
    12        properties:
    13          secretName: git-secret
    14          data:
    15            token: <git token>
    16      # or use kubectl create secret docker-registry docker-regcred \
    17      # --docker-server=https://index.docker.io/v1/ \
    18      # --docker-username=<your-username> \
    19      # --docker-password=<your-password> 
    20      - name: create-image-secret
    21        type: export2secret
    22        properties:
    23          secretName: image-secret
    24          kind: docker-registry
    25          dockerRegistry:
    26            username: <docker username>
    27            password: <docker password>
    28      - name: build-push
    29        type: build-push-image
    30        properties:
    31          # use your kaniko executor image like below, if not set, it will use default image oamdev/kaniko-executor:v1.9.1
    32          # kanikoExecutor: gcr.io/kaniko-project/executor:latest
    33          # you can use context with git and branch or directly specify the context, please refer to https://github.com/GoogleContainerTools/kaniko#kaniko-build-contexts
    34          context:
    35            git: github.com/FogDong/simple-web-demo
    36            branch: main
    37          image: fogdong/simple-web-demo:v1
    38          # specify your dockerfile, if not set, it will use default dockerfile ./Dockerfile
    39          # dockerfile: ./Dockerfile
    40          credentials:
    41            image:
    42              name: image-secret
    43          # buildArgs:
    44          #   - key="value"
    45          # platform: linux/arm
    46      - name: apply-app
    47        type: apply-app
    48        properties:
    49          data:
    50            apiVersion: core.oam.dev/v1beta1
    51            kind: Application
    52            metadata:
    53              name: my-app
    54            spec:
    55              components:
    56                - name: my-web
    57                  type: webservice
    58                  properties:
    59                    image: fogdong/simple-web-demo:v1
    60                    ports:
    61                      - port: 80
    62                        expose: true