Skip to content

Commit

Permalink
chore: use universal developer image for dev container
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
  • Loading branch information
vitaliy-guliy committed Sep 7, 2023
1 parent fc445db commit 1c86198
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 1,916 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/pr-check-build-che-code-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#
# Copyright (c) 2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

name: Build che-code images Pull Request check

# Trigger the workflow on pull request
on:
pull_request:
paths-ignore:
- '**/*.md'
- devfile.yaml
- '.che/*'
- '.rebase/*'

jobs:
build-che-code:
runs-on: ubuntu-22.04
steps:

- name: Checkout che-code source code
uses: actions/checkout@v2

- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_PULL_REQUESTS_USERNAME }}
password: ${{ secrets.QUAY_PULL_REQUESTS_PASSWORD }}

- name: Compile linux-libc
run: |
docker buildx build \
--platform linux/amd64 \
--progress=plain \
-f build/dockerfiles/linux-libc.Dockerfile \
-t linux-libc-amd64 .
- name: Compile linux-musl
run: |
docker buildx build \
--platform linux/amd64 \
--progress=plain \
-f build/dockerfiles/linux-musl.Dockerfile \
-t linux-musl-amd64 .
- name: Display docker images
run: |
docker images
- name: Assemble che-code
run: |
PR_NUMBER="${{ github.event.number }}"
echo "Pull request $PR_NUMBER"
IMAGE_NAME="quay.io/che-incubator-pull-requests/che-code:pr-$PR_NUMBER-amd64"
echo "_IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV
docker buildx build \
--platform linux/amd64 \
--progress=plain \
--push \
-f build/dockerfiles/assembly.Dockerfile \
-t ${IMAGE_NAME} .
- name: Display docker images (final)
run: |
docker images
- name: 'Comment PR'
uses: actions/github-script@v6
with:
script: |
const { repo: { owner, repo } } = context;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Pull Request Che-Code image published:\n👉 [${process.env._IMAGE_NAME}](https://${process.env._IMAGE_NAME})`
})
69 changes: 69 additions & 0 deletions .github/workflows/pr-check-build-dev-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#
# Copyright (c) 2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#

name: Build che-code Dev image Pull Request check

# Trigger the workflow on pull request
on:
pull_request:
paths-ignore:
- '**/*.md'
- devfile.yaml
- '.che/*'
- '.rebase/*'

jobs:
build-che-code-dev:
runs-on: ubuntu-22.04
steps:

- name: Checkout che-code source code
uses: actions/checkout@v2

- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_PULL_REQUESTS_USERNAME }}
password: ${{ secrets.QUAY_PULL_REQUESTS_PASSWORD }}

- name: Build Che-Code Docker image
run: |
PR_NUMBER="${{ github.event.number }}"
echo "Pull request $PR_NUMBER"
DEV_IMAGE_NAME="quay.io/che-incubator-pull-requests/che-code-dev:pr-$PR_NUMBER-dev-amd64"
echo "Dev image $DEV_IMAGE_NAME"
echo "_DEV_IMAGE_NAME=${DEV_IMAGE_NAME}" >> $GITHUB_ENV
docker buildx build \
--platform linux/amd64 \
--progress=plain \
--push \
-f build/dockerfiles/dev.Dockerfile \
-t ${DEV_IMAGE_NAME} .
- name: Display docker images
run: |
docker images
- name: 'Comment PR'
uses: actions/github-script@v6
with:
script: |
const { repo: { owner, repo } } = context;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Pull Request Dev image published:\n👉 [${process.env._DEV_IMAGE_NAME}](https://${process.env._DEV_IMAGE_NAME})`
})
111 changes: 0 additions & 111 deletions .github/workflows/pr-check-image-publish.yml

This file was deleted.

92 changes: 0 additions & 92 deletions .github/workflows/pr-check.yml

This file was deleted.

Loading

0 comments on commit 1c86198

Please sign in to comment.