Skip to content

Commit

Permalink
chore(ci): add branch pre-alfa in build workflow (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
universal-itengineer authored May 23, 2024
2 parents 36712f3 + 7bcc743 commit b044a54
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/dev_module_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
push:
branches:
- main
- pre-alpha

defaults:
run:
Expand All @@ -25,22 +26,30 @@ concurrency:
cancel-in-progress: true

jobs:
show_dev_manifest:
set_vars:
runs-on: ubuntu-latest
name: Show manifest
name: Set MODULES_MODULE_TAG
outputs:
modules_module_tag: ${{ steps.modules_module_tag.outputs.MODULES_MODULE_TAG }}
steps:
- name: Set vars for PR
if: ${{ github.ref_name != 'main' }}
- name: Set vars
id: modules_module_tag
run: |
MODULES_MODULE_TAG="$(echo pr${{github.event.pull_request.number}})"
echo "MODULES_MODULE_TAG=$MODULES_MODULE_TAG" >> "$GITHUB_ENV"
if [[ "${{ github.ref_name }}" == 'pre-alpha' || "${{ github.ref_name }}" == 'main' ]]; then
MODULES_MODULE_TAG="${{ github.ref_name }}"
else
MODULES_MODULE_TAG="$(echo pr${{ github.event.pull_request.number }})"
fi
- name: Set vars for main
if: ${{ github.ref_name == 'main' }}
run: |
MODULES_MODULE_TAG="$(echo v0.0.0-${{ github.ref_name }})"
echo "MODULES_MODULE_TAG=$MODULES_MODULE_TAG" >> "$GITHUB_ENV"
echo "MODULES_MODULE_TAG=$MODULES_MODULE_TAG" >> "$GITHUB_OUTPUT"
show_dev_manifest:
runs-on: ubuntu-latest
name: Show manifest
needs: set_vars
env:
MODULES_MODULE_TAG: ${{needs.set_vars.outputs.modules_module_tag}}
steps:
- name: Show dev config
run: |
cat << OUTER
Expand Down Expand Up @@ -146,19 +155,10 @@ jobs:
dev_setup_build:
runs-on: ubuntu-latest
name: Build and Push images
needs: set_vars
env:
MODULES_MODULE_TAG: ${{needs.set_vars.outputs.modules_module_tag}}
steps:
- name: Set vars for PR
if: ${{ github.ref_name != 'main' }}
run: |
MODULES_MODULE_TAG="$(echo pr${{github.event.pull_request.number}})"
echo "MODULES_MODULE_TAG=$MODULES_MODULE_TAG" >> "$GITHUB_ENV"
- name: Set vars for main
if: ${{ github.ref_name == 'main' }}
run: |
MODULES_MODULE_TAG="$(echo v0.0.0-${{ github.ref_name }})"
echo "MODULES_MODULE_TAG=$MODULES_MODULE_TAG" >> "$GITHUB_ENV"
- name: Print vars
run: |
echo MODULES_REGISTRY=$MODULES_REGISTRY
Expand All @@ -180,8 +180,8 @@ jobs:

- run: |
IMAGE_SRC="$(jq -r '.Images."bundle".DockerImageName' images_tags_werf.json)"
IMAGE_DST="$(jq -r '.Images.bundle.DockerRepo' images_tags_werf.json):main"
IMAGE_DST="$(jq -r '.Images.bundle.DockerRepo' images_tags_werf.json):v0.0.0-main"
echo "✨ Bundle image : Pushing ${IMAGE_SRC} to ${IMAGE_DST}"
crane copy ${IMAGE_SRC} ${IMAGE_DST}
if: ${{ github.ref_name == 'main' }}
name: Bundle image tag main
name: Push legacy module tag v0.0.0-main

0 comments on commit b044a54

Please sign in to comment.