diff --git a/.github/workflows/deploy.yml b/.github/workflows/ghpage-deploy.yml similarity index 87% rename from .github/workflows/deploy.yml rename to .github/workflows/ghpage-deploy.yml index 5c9b25d..19dcb6e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/ghpage-deploy.yml @@ -1,61 +1,60 @@ -name: GitHub Pages CI (Astro) -on: - push: - branches: main - pull_request: - branches: main - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: false - -env: - BUILD_PATH: . - SITE_URL: https://avonbied.github.io - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: lts/hydrogen - cache: 'yarn' - cache-dependency-path: ${{ env.BUILD_PATH }}/*.lock - - name: Setup Pages - id: pages - uses: actions/configure-pages@v3 - - name: Install dependencies - run: yarn install - working-directory: ${{ env.BUILD_PATH }} - - name: Build with Astro - run: | - yarn astro build \ - --base "${{ steps.pages.outputs.base_path }}" - working-directory: ${{ env.BUILD_PATH }} - env: - SITE_URL: "${{ steps.pages.outputs.origin }}" - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: ${{ env.BUILD_PATH }}/dist - - deploy: - needs: build - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Deploy to GitHub Pages - id: deployment +name: GitHub Pages CI (Astro) +on: + push: + branches: main + pull_request: + branches: main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +env: + BUILD_PATH: . + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: lts/hydrogen + cache: 'yarn' + cache-dependency-path: ${{ env.BUILD_PATH }}/*.lock + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + - name: Install dependencies + run: yarn install + working-directory: ${{ env.BUILD_PATH }} + - name: Build with Astro + env: + SITE_URL: "${{ steps.pages.outputs.origin }}" + SITE_BASE: "${{ steps.pages.outputs.base_path }}" + run: | + yarn astro build + working-directory: ${{ env.BUILD_PATH }} + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ${{ env.BUILD_PATH }}/dist + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment uses: actions/deploy-pages@v1 \ No newline at end of file