Skip to content

πŸ—οΈ Build 2/merge #11

πŸ—οΈ Build 2/merge

πŸ—οΈ Build 2/merge #11

Workflow file for this run

name: πŸ—οΈ Build
on:
push:
paths-ignore:
- .github/**
pull_request:
workflow_dispatch:
merge_group:
create:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
AWS_REGION: "eu-west-1"
permissions:
actions: read
checks: write
contents: write
deployments: read
id-token: write
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
run-name: πŸ—οΈ Build ${{ github.ref_name }}
jobs:
# =====================================================
# Job: Build
# =====================================================
build:
runs-on: ubuntu-latest
outputs:
sha_tag: ${{ steps.app_info.outputs.sha_tag }}
version_tag: ${{ steps.get_version.outputs.version }}
branch_tag: ${{ steps.app_info.outputs.branch_tag }}
steps:
- name: βœ… Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.VENLY_GITHUB_ACTIONS_TOKEN }}
- name: ℹ️ App Info
id: app_info
uses: ./.github/actions/app_info
with:
branch: ${{ github.ref }}
- name: πŸ” Get Version
id: get_version
uses: ./.github/actions/get_version
- name: πŸ“„ Show Build Information
run: |
echo "Sha Tag: ${{ steps.app_info.outputs.sha_tag }}"
echo "Version Tag: ${{ steps.get_version.outputs.version }}"
echo "Branch Tag: ${{ steps.app_info.outputs.branch_tag }}"
# =====================================================
# Job: Build Docker
# =====================================================
docker:
if: ${{ success() && github.event_name != 'pull_request' && contains(fromJSON('["main", "master", "develop"]'), github.ref_name) || startsWith(github.ref_name, 'release-') || startsWith(github.ref_name, 'hotfix-') || startsWith(github.ref_name, 'VENLY-') }}
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
include:
- ecr: venly-react-demo-eu-west-1
docker_context: "connect-sdk"
steps:
- name: βœ… Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.VENLY_GITHUB_ACTIONS_TOKEN }}
- name: 🐳 Build and Push Docker Image
id: build-deploy-docker
uses: ./.github/actions/build_docker
with:
aws_role: ${{ secrets.RESOURCES_DEPLOY_ROLE }}
docker_context: ${{ matrix.docker_context }}
ecr_repo: ${{ matrix.ecr }}
sha_tag: ${{ needs.build.outputs.sha_tag }}
version_tag: ${{ needs.build.outputs.version_tag }}
branch_tag: ${{ needs.build.outputs.branch_tag }}
push_image: true
# =====================================================
# Job: Merge Back
# =====================================================
merge-back:
if: startsWith(github.ref, 'refs/heads/hotfix-') || startsWith(github.ref, 'refs/heads/release-')
needs:
- build
- docker
runs-on: ubuntu-latest
outputs:
runner_name: ${{ runner.name }}
steps:
- name: βœ… Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.VENLY_GITHUB_ACTIONS_TOKEN }}
- name: πŸ”„ Merge Back To Develop
id: merge_back
uses: ArkaneNetwork/venly-github-workflows/.github/actions/merge_back@main
with:
branch: ${{ github.ref }}
token: ${{ secrets.VENLY_GITHUB_ACTIONS_TOKEN }}