Publish image & helm #17
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: Publish image & helm | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
Publish-image: | |
name: Publish image | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_IMAGE: lotest/${{ github.event.repository.name }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3.4.2 | |
- name: Build docker image | |
run: ./gradlew jibDockerBuild -i --image $DOCKER_IMAGE | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push image to repository | |
run: docker push --all-tags $DOCKER_IMAGE | |
helm-chart-release: | |
name: Publish Helm chart | |
runs-on: ubuntu-latest | |
permissions: write-all | |
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 "$GITHUB_ACTOR@users.noreply.github.com" | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.10.0 | |
- name: Custom packaging | |
run: | | |
VERSION=${{github.ref_name}} | |
rm -rf .cr-release-packages | |
mkdir -p .cr-release-packages | |
helm package charts/locust-k8s-operator --app-version=${VERSION} --version=${VERSION} --destination=.cr-release-packages | |
- name: Run chart-releaser | |
# switch back to helm/chart-releaser-action when https://github.com/helm/chart-releaser-action/pull/109 is merged | |
# Waiting for a new release to include changes coming from https://github.com/helm/chart-releaser-action/commit/38cfeacdbbd62d13ec773fcdee1435ff5846c554 | |
uses: askcloudarchitech/chart-releaser-action@skip-packaging-option | |
with: | |
skip_packaging: true | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
docs-release: | |
name: Publish documentation | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
pip install \ | |
mkdocs-material \ | |
mkdocs-git-revision-date-localized-plugin | |
- name: Build documentation | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
python -m mkdocs build | |
- name: Deploy documentation | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./site | |
keep_files: true | |
user_name: ${{ github.actor }} | |
user_email: ${{ github.actor }}@users.noreply.github.com |