Skip to content

Commit

Permalink
update (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-johan-grahn authored Sep 17, 2024
1 parent cd708fd commit 064f266
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 49 deletions.
37 changes: 5 additions & 32 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
name: Build
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha}}

# Setting up helm binary
- name: Set up Helm
uses: azure/setup-helm@v3
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
# run: |
# kind create cluster
# kubectl cluster-info

# - name: Test
# run: make test

Expand All @@ -74,7 +74,7 @@ jobs:
sha=${{ github.event.pull_request.head.sha }}
tag="SNAPSHOT-PR-${{ github.event.pull_request.number }}-${sha:0:8}"
echo "GIT_TAG=$(echo ${tag})" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down Expand Up @@ -103,30 +103,3 @@ jobs:
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
# - name: Comment on PR
# uses: mshick/add-pr-comment@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# message: '@${{ github.actor }} Image is available for testing. `docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`'
# allow-repeats: true

# - name: Notify Failure
# if: failure()
# uses: mshick/add-pr-comment@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# message: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
# allow-repeats: true

# - name: Notify Slack
# uses: 8398a7/action-slack@v3
# if: always() # Pick up events even if the job fails or is canceled.
# with:
# status: ${{ job.status }}
# fields: repo,author,action,eventName,ref,workflow
# env:
# GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
# SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
30 changes: 15 additions & 15 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
id: generate_tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
DRY_RUN: true
Expand All @@ -87,11 +87,11 @@ jobs:
registry: ${{env.REGISTRY}}
username: stakater-user
password: ${{secrets.GITHUB_TOKEN}}

- name: Generate image repository path for ghcr registry
run: |
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and push image to ghcr registry
uses: docker/build-push-action@v5
with:
Expand All @@ -108,7 +108,7 @@ jobs:
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Login to DockerHub Registry
uses: docker/login-action@v3
with:
Expand All @@ -135,7 +135,7 @@ jobs:
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
##############################
## Add steps to generate required artifacts for a release here(helm chart, operator manifest etc.)
##############################
Expand All @@ -145,7 +145,7 @@ jobs:
id: generate_operator_tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
WITH_V: false
DEFAULT_BUMP: patch
DRY_RUN: true
Expand All @@ -163,7 +163,7 @@ jobs:
branch: master
repository: stakater-charts
target_dir: docs
token: ${{ secrets.STAKATER_GITHUB_TOKEN }}
token: ${{ secrets.GHCR_TOKEN }}
charts_dir: deployments/kubernetes/chart/
charts_url: ${{ env.HELM_REGISTRY_URL }}
owner: stakater
Expand All @@ -179,30 +179,30 @@ jobs:
--set forecastle.config.namespaceSelector.any=true > deployments/kubernetes/forecastle.yaml
helm template forecastle deployments/kubernetes/chart/forecastle/ --include-crds --output-dir deployments/kubernetes/manifests/ \
--set forecastle.service.expose="true" --set forecastle.route.enabled=true --set forecastle.route.tls.termination=reencrypt \
--set forecastle.config.namespaceSelector.any=true --set forecastle.config.crdEnabled=true
mv deployments/kubernetes/manifests/forecastle/templates/* deployments/kubernetes/manifests/
mv deployments/kubernetes/manifests/forecastle/crds/* deployments/kubernetes/manifests/
--set forecastle.config.namespaceSelector.any=true --set forecastle.config.crdEnabled=true
mv deployments/kubernetes/manifests/forecastle/templates/* deployments/kubernetes/manifests/
mv deployments/kubernetes/manifests/forecastle/crds/* deployments/kubernetes/manifests/
rm -r deployments/kubernetes/manifests/forecastle
# Commit back changes
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "stakater-user"
git status
git status
git add .
git commit -m "[skip-ci] Update artifacts" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.STAKATER_GITHUB_TOKEN }}
github_token: ${{ secrets.PUBLISH_TOKEN }}
branch: ${{ github.ref }}

- name: Push Latest Tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch

Expand All @@ -213,5 +213,5 @@ jobs:
status: ${{ job.status }}
fields: repo,author,action,eventName,ref,workflow
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}

- name: Notify Slack
uses: 8398a7/action-slack@v3
Expand All @@ -37,5 +37,5 @@ jobs:
status: ${{ job.status }}
fields: repo,author,action,eventName,ref,workflow
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}

0 comments on commit 064f266

Please sign in to comment.