Skip to content

feat: add helm tests #4

feat: add helm tests

feat: add helm tests #4

Workflow file for this run

name: Push to production ☁️
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
test_helm:
uses: ./github/workflows/test_helm_chart.yaml

Check failure on line 10 in .github/workflows/cicd.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/cicd.yml

Invalid workflow file

invalid value workflow reference: no version specified
build:
runs-on: ubuntu-latest
outputs:
sha_short: ${{ steps.variables.outputs.sha_short }}
build_date: ${{ steps.variables.outputs.build_date }}
no_v: ${{ steps.set_version.outputs.no_v }}
steps:
- name: Clone project
uses: actions/checkout@v3
# =============================
# This will be activated later
# =============================
# - name : Set up JDK 11
# uses: actions/setup-java@v2
# with:
# java-version: '11'
# distribution: 'adopt'
# cache: 'maven'
# - name: install dependencies
# run: mvn install -DskipTests
# - name: Run JUNIT tests
# run: mvn test
- name: Get short commit hash
id: variables
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "build_date=$(date --rfc-3339=ns)" >> $GITHUB_OUTPUT
- name: Set Versions
uses: actions/github-script@v4
id: set_version
with:
script: |
const tag = context.ref.substring(10)
const no_v = tag.replace('v', '')
core.setOutput('no_v', no_v)
build_n_push_prod:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Login to ghcr.io
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
build-args: |
AGROLD_NAME=agrold
AGROLD_DESCRIPTION="agrold production instance"
GIT_COMMIT=${{ needs.build.outputs.sha_short }}
BUILD_DATE=${{ needs.build.outputs.build_date }}
push: true
context: ./agrold-javaweb
file: ./agrold-javaweb/Dockerfile
tags: ghcr.io/southgreenplatform/agrold:${{ needs.build.outputs.no_v }},ghcr.io/southgreenplatform/agrold:latest
build_n_push_private:
needs: build
uses: ./.github/workflows/push_to_private.yml
with:
build-args: AGROLD_NAME=agrold,AGROLD_DESCRIPTION="Agrold from version ${{ needs.build.outputs.no_v }} commit ${{ needs.build.outputs.sha_short }}",GIT_COMMIT=${{ needs.build.outputs.no_v }},BUILD_DATE="${{ needs.build.outputs.build_date }}"
context: ./agrold-javaweb
dockerfile: ./agrold-javaweb/Dockerfile
image_name: agrolddev
tag: ${{ needs.build.outputs.no_v }}
registry_host: "10.9.2.21:8080"
secrets:
DOCKER_REGISTRY_USER: ${{ secrets.DOCKER_REGISTRY_USER }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}