v1.9.2 #24
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
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
name: "Publish Docker Images" | |
jobs: | |
helmRelease: | |
name: "Package Helm Chart" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: "Install yq" | |
run: | | |
sudo snap install yq | |
- name: "Patch Chart.yaml to the current released version" | |
working-directory: helm/wrongsecrets-ctf-party/ | |
run: | | |
RELEASE_VERSION="${GITHUB_REF#refs/*/}" | |
# Remove leading 'v' from git tag to create valid semver | |
RELEASE_VERSION="${RELEASE_VERSION//v}" | |
# patch the version & appVersion in the Chart.yaml to the release version | |
yq eval -i ".version = \"$RELEASE_VERSION\", .appVersion = \"$RELEASE_VERSION\"" Chart.yaml | |
- name: install helm-docs | |
env: | |
HELM_DOCS_VERSION: "1.11.0" | |
run: | | |
cd /tmp | |
wget https://github.com/norwoodj/helm-docs/releases/download/v${{env.HELM_DOCS_VERSION}}/helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz | |
tar -xvf helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz | |
sudo mv helm-docs /usr/local/sbin | |
- name: Generate and Release Helm Docs | |
run: | | |
helm-docs -t helm/wrongsecrets-ctf-party/README.md.gotmpl -t helm/wrongsecrets-ctf-party/_template.gotmpl -o README.md | |
cp helm/wrongsecrets-ctf-party/README.md /tmp/README.md | |
- name: Update gh-pages branch | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
fetch-depth: 0 | |
- name: Copy README.md to gh-pages | |
run: | | |
cp /tmp/README.md README.md | |
- name: Commit and push changes (if any) | |
run: | | |
if git diff --exit-code; then | |
echo "No changes detected." | |
else | |
echo "Changes detected." | |
git add README.md | |
git commit -m "Update README.md" | |
git push | |
fi | |
- name: Get back to original branch | |
uses: actions/checkout@v4 | |
- name: Run chart-releaser | |
uses: helm/[email protected] | |
with: | |
charts_dir: helm | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
dockerBuilds: | |
name: "Build" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
component: | |
- cleaner | |
- wrongsecrets-balancer | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker Meta | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: iteratec/${{ matrix.component }} | |
tags: | | |
type=semver,pattern={{raw}} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and Push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./${{ matrix.component }} | |
file: ./${{ matrix.component }}/Dockerfile | |
platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
push: true | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} |