fix(cicd): remove unused job #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push to production ☁️ | |
on: | |
push: | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ | |
jobs: | |
publish_helm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Run chart-releaser | |
uses: ./.github/actions/chart-releaser-action | |
env: | |
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
with: | |
mark_as_latest: true | |
skip_existing: false | |
charts_dir: ./agrold-javaweb/charts | |
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/login-action@v2.1.0 | |
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 }} |