From 37396c83a9db2f24a7bfc69a3f10f2bfa6e96ac5 Mon Sep 17 00:00:00 2001 From: Ross Bulat Date: Tue, 25 Jun 2024 18:09:07 +0700 Subject: [PATCH] chore: automate gh deployment --- .github/workflows/gh-pages.yml | 46 ++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 17fb002..4827023 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -8,7 +8,7 @@ env: FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }} jobs: - gh-deploy: + merge: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -29,6 +29,21 @@ jobs: target_branch: gh-deploy github_token: ${{ secrets.GITHUB_TOKEN }} + + build: + runs-on: ubuntu-latest + needs: merge + steps: + - uses: actions/checkout@v4 + with: + ref: gh-deploy + + - uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: https://registry.npmjs.org + cache: 'yarn' + - name: Install run: yarn install @@ -36,7 +51,34 @@ jobs: working-directory: '.' run: yarn build:pages - - name: Deploy + - name: Update `gh-pages` branch uses: JamesIves/github-pages-deploy-action@v4 with: folder: build + + - name: Upload Artifact + uses: actions/upload-pages-artifact@v3 + with: + name: github-pages + path: build + + deploy: + runs-on: ubuntu-latest + needs: build + + permissions: + id-token: write + pages: write + + environment: + name: github-pages + url: ${{steps.deployment.outputs.page_url}} + + steps: + - uses: actions/download-artifact@master + with: + name: github-pages + path: build + - uses: actions/configure-pages@v5 + - id: deployment + uses: actions/deploy-pages@main \ No newline at end of file