Skip to content

Merge pull request #484 from stakater-lab/testing #38

Merge pull request #484 from stakater-lab/testing

Merge pull request #484 from stakater-lab/testing #38

Workflow file for this run

name: Push
on:
push:
branches: main
env:
DOCKER_FILE_PATH: Dockerfile
jobs:
build-test-code:
runs-on: ubuntu-latest
name: Build
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"
- name: Generate Tag
id: generate_tag
uses: anothrNick/github-tag-action@1.61.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DEFAULT_BUMP: patch
RELEASE_BRANCHES: main
DRY_RUN: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ghcr.io/stakater-lab
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate image repository path
run: |
echo IMAGE_REPOSITORY=$(echo ghcr.io/stakater-lab/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
pull: true
push: true
cache-to: type=inline
tags: |
${{ env.IMAGE_REPOSITORY }}:v${{ steps.generate_tag.outputs.new_tag }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Package and Push Helm Chart
run: |
sed -i "s/^version:.*/version: ${{ steps.generate_tag.outputs.new_tag }}/" deploy/Chart.yaml
helm dependency update deploy/
helm package deploy/
helm push stakater-nordmart-review-${{ steps.generate_tag.outputs.new_tag }}.tgz oci://ghcr.io/stakater-lab/charts
- name: Push Latest Tag
uses: anothrNick/github-tag-action@1.66.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
RELEASE_BRANCHES: main
DEFAULT_BUMP: patch