Skip to content

Fix v0 abort deleting v1alpha testrun Jobs #95

Fix v0 abort deleting v1alpha testrun Jobs

Fix v0 abort deleting v1alpha testrun Jobs #95

Workflow file for this run

name: Build and push
on:
pull_request_target:
branches: [ "main" ]
types:
- closed
workflow_dispatch:
env:
MAIN_BRANCH: main
permissions:
contents: write
packages: write
jobs:
build-api:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build app image
run: docker build . --tag image
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image ID
id: image
run: |
IMAGE_ID=ghcr.io/eiffel-community/etos-api
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "$MAIN_BRANCH" ] && VERSION=$(echo ${{ github.sha }} | cut -c1-8)
echo VERSION=$VERSION
echo "image=$IMAGE_ID" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Push app image
run: |
docker tag image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version}}
echo "Pushing image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}"
docker push ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}
outputs:
apiImage: ${{ steps.image.outputs.image }}
apiVersion: ${{ steps.image.outputs.version }}
build-sse:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build app image
run: docker build . -f deploy/etos-sse/Dockerfile --tag image
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image ID
id: image
run: |
IMAGE_ID=ghcr.io/eiffel-community/etos-sse
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "$MAIN_BRANCH" ] && VERSION=$(echo ${{ github.sha }} | cut -c1-8)
echo VERSION=$VERSION
echo "image=$IMAGE_ID" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Push app image
run: |
docker tag image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version}}
echo "Pushing image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}"
docker push ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}
outputs:
sseImage: ${{ steps.image.outputs.image }}
sseVersion: ${{ steps.image.outputs.version }}
build-keys:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build app image
run: docker build . -f deploy/etos-keys/Dockerfile --tag image
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image ID
id: image
run: |
IMAGE_ID=ghcr.io/eiffel-community/etos-keys
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "$MAIN_BRANCH" ] && VERSION=$(echo ${{ github.sha }} | cut -c1-8)
echo VERSION=$VERSION
echo "image=$IMAGE_ID" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Push app image
run: |
docker tag image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version}}
echo "Pushing image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}"
docker push ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}
outputs:
keysImage: ${{ steps.image.outputs.image }}
keysVersion: ${{ steps.image.outputs.version }}
build-logarea:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build app image
run: docker build . -f deploy/etos-logarea/Dockerfile --tag image
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image ID
id: image
run: |
IMAGE_ID=ghcr.io/eiffel-community/etos-logarea
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "$MAIN_BRANCH" ] && VERSION=$(echo ${{ github.sha }} | cut -c1-8)
echo VERSION=$VERSION
echo "image=$IMAGE_ID" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Push app image
run: |
docker tag image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version}}
echo "Pushing image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}"
docker push ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}
outputs:
logareaImage: ${{ steps.image.outputs.image }}
logareaVersion: ${{ steps.image.outputs.version }}
build-iut:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build app image
run: docker build . -f deploy/etos-iut/Dockerfile --tag image
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image ID
id: image
run: |
IMAGE_ID=ghcr.io/eiffel-community/etos-iut
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "$MAIN_BRANCH" ] && VERSION=$(echo ${{ github.sha }} | cut -c1-8)
echo VERSION=$VERSION
echo "image=$IMAGE_ID" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Push app image
run: |
docker tag image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version}}
echo "Pushing image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}"
docker push ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}
outputs:
iutImage: ${{ steps.image.outputs.image }}
iutVersion: ${{ steps.image.outputs.version }}
build-executionspace:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build app image
run: docker build . -f deploy/etos-executionspace/Dockerfile --tag image
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image ID
id: image
run: |
IMAGE_ID=ghcr.io/eiffel-community/etos-executionspace
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "$MAIN_BRANCH" ] && VERSION=$(echo ${{ github.sha }} | cut -c1-8)
echo VERSION=$VERSION
echo "image=$IMAGE_ID" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Push app image
run: |
docker tag image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version}}
echo "Pushing image ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}"
docker push ${{ steps.image.outputs.image }}:${{ steps.image.outputs.version }}
outputs:
executionSpaceImage: ${{ steps.image.outputs.image }}
executionSpaceVersion: ${{ steps.image.outputs.version }}
run-update-etos-defaults:
# We only update API, SSE and LogArea since those are the only ones that
# are automatically deployed by the ETOS cluster controller.
needs: [build-api, build-sse, build-logarea]
uses: ./.github/workflows/update-etos.yaml
secrets: inherit
with:
api-image: ${{ needs.build-api.outputs.apiImage }}
api-version: ${{ needs.build-api.outputs.apiVersion }}
sse-image: ${{ needs.build-sse.outputs.sseImage }}
sse-version: ${{ needs.build-sse.outputs.sseVersion }}
logarea-image: ${{ needs.build-logarea.outputs.logareaImage }}
logarea-version: ${{ needs.build-logarea.outputs.logareaVersion }}