From d7706173473aa7d0a692006b3d965d6d0c6b49ec Mon Sep 17 00:00:00 2001 From: Khalid Elshafie Date: Fri, 26 Jul 2024 16:37:50 +1000 Subject: [PATCH] ci: add deploy to github pages step (#27) --- .github/workflows/release.yml | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e108d8f..3389d19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,12 +10,20 @@ jobs: name: Release runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 + with: + persist-credentials: false - uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' - run: npm ci - run: npm run build --if-present - run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + - name: Deploy with gh-pages + run: | + git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + npx gh-pages -d build -u "github-actions-bot " env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index cd32ca1..aefe5d2 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "bugs": { "url": "https://github.com/abolkog/js-playground/issues" }, - "homepage": "https://github.com/abolkog/js-playground", + "homepage": "https://abolkog.github.io/js-playground", "browserslist": { "production": [ ">0.2%",