Skip to content

Commit

Permalink
Fix website deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladicek committed Oct 25, 2024
1 parent 0869cf0 commit 349f269
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 10 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,28 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/create-github-app-token@v1
id: app-token
name: Create GitHub App Token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
ref: main
token: ${{secrets.RELEASE_TOKEN}}
token: ${{steps.app-token.outputs.token}}

- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Configure Git author
run: |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
- name: extract website
uses: actions/download-artifact@v4
Expand All @@ -84,8 +101,6 @@ jobs:

- name: push website
run: |
git config --global user.name "SmallRye CI"
git config --global user.email "[email protected]"
git status
git diff
git add -A .
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/demand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,28 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/create-github-app-token@v1
id: app-token
name: Create GitHub App Token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
ref: main
token: ${{secrets.RELEASE_TOKEN}}
token: ${{steps.app-token.outputs.token}}

- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Configure Git author
run: |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
- name: extract website
uses: actions/download-artifact@v4
Expand All @@ -65,8 +82,6 @@ jobs:

- name: push website
run: |
git config --global user.name "SmallRye CI"
git config --global user.email "[email protected]"
git status
git diff
git add -A .
Expand Down

0 comments on commit 349f269

Please sign in to comment.