Skip to content

Merge branch 'develop' #231

Merge branch 'develop'

Merge branch 'develop' #231

Workflow file for this run

name: Build
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: maven
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: v18
cache: 'npm'
cache-dependency-path: |
shopping-ui/package-lock.json
- name: "Set up Snyk CLI"
uses: snyk/actions/setup@master
- name: Build and Deploy with Maven
run: mvn -s .github/workflows/maven-settings.xml package -B -V
- name: Login to Docker Hub and Publish the Docker Images
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: |
echo "$DOCKER_PASSWORD" | docker login --username $DOCKER_USERNAME --password-stdin
cd gateway
./ci/buildAndPushDockerImages.bash latest ${{ github.ref_name }}
cd ..
cd bestseller-toys
./ci/buildAndPushDockerImages.bash latest ${{ github.ref_name }}
cd ..
cd bestseller-fashion
./ci/buildAndPushDockerImages.bash latest ${{ github.ref_name }}
cd ..
cd hot-deals
./ci/buildAndPushDockerImages.bash latest ${{ github.ref_name }}
cd ..
cd inventory-service-mock
./ci/buildAndPushDockerImages.bash latest ${{ github.ref_name }}
cd ..
cd order
./ci/buildAndPushDockerImages.bash latest ${{ github.ref_name }}
cd ..
cd checkout
./ci/buildAndPushDockerImages.bash latest ${{ github.ref_name }}
cd ..
- name: Dispatch event to trigger deployment to DEV
if: github.ref == 'refs/heads/develop'
run: |
curl -XPOST -u "${{ secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/steadybit/demo-infrastructure/dispatches --data '{"event_type": "deploy-to-dev-demo"}'
curl -XPOST -u "${{ secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/steadybit/demo-infrastructure/dispatches --data '{"event_type": "deploy-to-sandbox-demo"}'
- name: Dispatch event to trigger deployment to PROD
if: github.ref == 'refs/heads/main'
run: |
curl -XPOST -u "${{ secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/steadybit/demo-infrastructure/dispatches --data '{"event_type": "deploy-to-prod-demo"}'
test-helm-charts:
name: "Test Helm Charts"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.12.2
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Add unit testing plugin
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git
- name: Run unit tests
run: make charttesting
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (lint)
run: make chartlint
release-helm-chart:
name: "Release Helm Chart"
runs-on: ubuntu-latest
needs: [ test-helm-charts ]
if: github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.12.2
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: charts
mark_as_latest: false
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"