withastro / action

A GitHub Action that deploys your Astro project to GitHub Pages
Other
153 stars 34 forks source link

Upgrade action versions and default to node 20 #41

Closed LeadingMoominExpert closed 7 months ago

LeadingMoominExpert commented 8 months ago

As stated in the issue here https://github.com/withastro/action/issues/40, current withastro/action does not work with action/deploy-pages@v4 and upgrading to actions using node 20 is not possible.

This pull request would make v2 release for your action. I tested it with application built with npm and built it using an action published from a fork, and a workflow file like

name: Deploy

on:
  push:
    branches:
    - main
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - name: Checkout your repository using git
        uses: actions/checkout@v4

      - name: Install, build, and upload your site
        uses: LeadingMoominExpert/withastro-action@v2

  deploy:
    needs: build
    timeout-minutes: 15
    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@v4

Note that the example uses actions/deploy-pages@v4, which was not previously possible

Resolves https://github.com/withastro/action/issues/40

natemoo-re commented 7 months ago

Thank you! This is on my list to review and merge today.