Skip to content

Commit

Permalink
update gh action: update git config with machine user
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mattia-m committed May 29, 2024
1 parent 1503eb9 commit b7aaccf
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,35 @@ on:
- created

env:
TAG_NAME: ${{ github.event.release.tag_name }}
REPOSITORY_NAME: auth-playground
GH_USERNAME: m-mattia-m
GH_USERNAME: m-mattia-m-machine
GH_EMAIL: [email protected]
DOMAIN: auth-playground.makefermion.com

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup git user
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: Clean-install npm dependencies
run: npm ci
- name: Generate nuxt files
run: npm run generate
# - name: Add & Commit
# uses: EndBug/[email protected]
- name: Commit report
run: |
git config --global user.name '$GH_USERNAME'
git config --global user.email '$GH_EMAIL'
- name: Publish
run: npm run deploy
- name: Update GitHub Pages settings
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_MACHINE_TOKEN: ${{ secrets.GH_MACHINE_TOKEN }}
run: |
curl -X PATCH \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Authorization: token GH_MACHINE_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/$REPOSITORY_NAME \
-d '{"name": "'$REPOSITORY_NAME'", "has_pages": true, "pages": {"cname": "'$DOMAIN'"}}'

0 comments on commit b7aaccf

Please sign in to comment.