Skip to content

Commit

Permalink
update gh action: use template
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mattia-m committed May 29, 2024
1 parent 23d90ce commit 4a7ef13
Showing 1 changed file with 5 additions and 31 deletions.
36 changes: 5 additions & 31 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,12 @@ on:
types:
- created

env:
TAG_NAME: ${{ github.event.release.tag_name }}
REPOSITORY_NAME: auth-playground
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: Clean-install npm dependencies
run: npm ci
- name: Generate nuxt files
run: npm run generate
# - name: Add & Commit
# uses: EndBug/[email protected]
- name: Set git config
run: |
echo "Usernmae: $GH_USERNAME"
echo "Usernmae: $GH_EMAIL"
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:
GH_MACHINE_TOKEN: ${{ secrets.GH_MACHINE_TOKEN }}
run: |
curl -X PATCH \
-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'"}}'
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GH_MACHINE_TOKEN }}
publish_dir: .output/public

0 comments on commit 4a7ef13

Please sign in to comment.