Skip to content

Commit

Permalink
Merge pull request #166 from chiukapoor/kubernetes-version-automation
Browse files Browse the repository at this point in the history
Fix the CI not getting triggered issue
  • Loading branch information
mitulshah-suse authored Nov 28, 2024
2 parents b083b58 + 3c4d8c0 commit d506089
Showing 1 changed file with 27 additions and 30 deletions.
57 changes: 27 additions & 30 deletions .github/workflows/kubernetes-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ jobs:
outputs:
new-release-branches: ${{ steps.create-release-branches.outputs.NEW_RELEASE_BRANCHES }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: 'rancher-k8s'
fetch-depth: 0
fetch-tags: true

- name: Configure git user
run: |
echo "[INFO] Setting up git user in git repository."
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Read App Secrets
uses: rancher-eio/read-vault-secrets@main
with:
Expand All @@ -39,6 +26,19 @@ jobs:
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
path: 'rancher-k8s'
fetch-depth: 0
fetch-tags: true
token: ${{ steps.app-token.outputs.token }}

- name: Configure git user
run: |
echo "[INFO] Setting up git user in git repository."
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Fetch the new tags from kubernetes/kubernetes repository
run: $GITHUB_WORKSPACE/rancher-k8s/scripts/check-for-new-tag.sh
Expand All @@ -48,8 +48,6 @@ jobs:
run: |
cd rancher-k8s
$GITHUB_WORKSPACE/rancher-k8s/scripts/create-release-branch.sh
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# - name: 'Tar files'
# run: |
Expand Down Expand Up @@ -81,10 +79,24 @@ jobs:
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Read App Secrets
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/github/app-credentials appId | APP_ID ;
secret/data/github/repo/${{ github.repository }}/github/app-credentials privateKey | PRIVATE_KEY
- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}

- name: Checkout repository with branch ${{ matrix.branches }}
uses: actions/checkout@v4
with:
ref: ${{ matrix.branches }}
token: ${{ steps.app-token.outputs.token }}

# - name: Download git repo from artifact
# uses: actions/download-artifact@v4
Expand All @@ -96,20 +108,6 @@ jobs:
# tar -zxf rancher-k8s.tar.gz
# rm rancher-k8s.tar.gz


- name: Read App Secrets
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/github/app-credentials appId | APP_ID ;
secret/data/github/repo/${{ github.repository }}/github/app-credentials privateKey | PRIVATE_KEY
- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}

- name: Build with Dapper for ${{ matrix.branches }}
run: dapper ci

Expand Down Expand Up @@ -139,5 +137,4 @@ jobs:
echo "[INFO] Successfully pushed tag $TAG: https://github.com/rancher/kubernetes/releases/tag/$TAG"
fi
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
RELEASE_BRANCH: ${{ matrix.branches }}

0 comments on commit d506089

Please sign in to comment.