From bd5c29651451b05ab1007a14c5929de0dd5c9f96 Mon Sep 17 00:00:00 2001 From: joel Date: Tue, 10 Dec 2024 13:31:49 -0700 Subject: [PATCH] update deploy.yml file as suggested by github help --- .github/workflows/deploy--OLD.yml | 36 ++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 37 +++++++++++++++++++------------ 2 files changed, 59 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/deploy--OLD.yml diff --git a/.github/workflows/deploy--OLD.yml b/.github/workflows/deploy--OLD.yml new file mode 100644 index 0000000..3a1915b --- /dev/null +++ b/.github/workflows/deploy--OLD.yml @@ -0,0 +1,36 @@ +name: Deploy GitHub Pages + +on: + push: + branches: + - main # Change to your default branch if it's not "main" + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install dependencies + run: npm ci + + - name: Build project + run: npm run build + + - name: List build output + run: | + ls -la dist/ + cat dist/index.html + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + personal_token: ${{ secrets.ACCESS_TOKEN }} # Use the PAT here + publish_dir: ./dist + #uses: JamesIves/github-pages-deploy-action@v4 + #with: + #branch: gh-pages # The branch to deploy to + #folder: dist # The folder to deploy + #token: ${{ secrets.ACCESS_TOKEN }} # Use your personal access token here diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3a1915b..052978f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,34 +3,43 @@ name: Deploy GitHub Pages on: push: branches: - - main # Change to your default branch if it's not "main" + - main + +permissions: + contents: read + pages: write + id-token: write jobs: build-and-deploy: runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout code uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install dependencies run: npm ci - name: Build project run: npm run build - - name: List build output - run: | - ls -la dist/ - cat dist/index.html + - name: Setup Pages + uses: actions/configure-pages@v3 - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 with: - personal_token: ${{ secrets.ACCESS_TOKEN }} # Use the PAT here - publish_dir: ./dist - #uses: JamesIves/github-pages-deploy-action@v4 - #with: - #branch: gh-pages # The branch to deploy to - #folder: dist # The folder to deploy - #token: ${{ secrets.ACCESS_TOKEN }} # Use your personal access token here + path: "./dist" + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2