Skip to content

Commit

Permalink
161 cross repo helm update workflow (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
akyriako authored Nov 21, 2024
1 parent 129b654 commit 4deef3c
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 152 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-publish-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
environment:
name: stable
runs-on: ubuntu-latest

outputs:
image_version: ${{ env.IMAGE_SEMVER }}

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -79,4 +81,6 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
annotations: ${{ steps.meta.outputs.annotations }}


49 changes: 46 additions & 3 deletions .github/workflows/build-publish-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ on:
- '**/CONTRIBUTING.md'
- '**/CONFIGURATION.md'
- '**/.devcontainer/**'
- "**/.github/workflows/**"
- "**/.github/workflows/**"
workflow_dispatch:

jobs:
build-preview:
name: Build Staging Artifacts
environment:
name: preview
runs-on: ubuntu-latest
outputs:
image_version: ${{ steps.build_image_tag.outputs.image_version }}

steps:
- name: Checkout
Expand All @@ -40,7 +43,7 @@ jobs:

- name: Build Image Tag
id: build_image_tag
run: echo "image_version=${{ steps.date.outputs.today }}-${{github.run_number}}-${{ steps.commit_hash.outputs.short }}" >> $GITHUB_OUTPUT
run: echo "image_version=${{ steps.date.outputs.today }}.${{github.run_number}}.0-${{ steps.commit_hash.outputs.short }}" >> $GITHUB_OUTPUT

- name: Build Container Image Metadata
id: meta
Expand Down Expand Up @@ -88,4 +91,44 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
annotations: ${{ steps.meta.outputs.annotations }}

update-helm-charts:
needs: [build-preview]
environment: preview
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Create GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_KEY }}
- name: Checkout Charts Repo
uses: actions/checkout@v4
with:
repository: "${{ vars.DOCS_NEXT_CHARTS_ORG }}/${{ vars.DOCS_NEXT_CHARTS_REPO }}"
token: ${{ steps.app-token.outputs.token }}
- name: Commit Changes
env:
image: ${{ vars.REGISTRY }}/${{ vars.REGISTRY_ORG }}/${{ vars.IMG_NAME }}
tag: ${{ needs.build-preview.outputs.image_version }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
sed -i 's/^tag: .*/tag: ${{ env.tag }}/' ./charts/docusaurus/values-stg.yaml
sed -i 's/^image: .*/image: ${{ env.image }}/' ./charts/docusaurus/values-stg.yaml
git commit -am "Automatic commit from GitHub Actions triggered by action #${{github.run_number}}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
env:
remote_pr_branch: 'release/staging-${{ needs.build-preview.outputs.image_version }}'
with:
title: ${{ env.remote_pr_branch }}
token: ${{ steps.app-token.outputs.token }}
branch: ${{ env.remote_pr_branch }}

7 changes: 0 additions & 7 deletions docs/blueprints/by-use-case/devops/crossplane/_category_.json

This file was deleted.

139 changes: 0 additions & 139 deletions docs/blueprints/by-use-case/devops/crossplane/overview.md

This file was deleted.

2 changes: 1 addition & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const config: Config = {
],
},
],
copyright: `© T-Systems International GmbH ${new Date().getFullYear()} (v` + process.env.REACT_APP_VERSION + `)`,
copyright: `© T-Systems International GmbH ${new Date().getFullYear()} (` + process.env.REACT_APP_VERSION + `)`,
},
prism: {
theme: prismThemes.oneDark,
Expand Down

0 comments on commit 4deef3c

Please sign in to comment.