Skip to content

Commit

Permalink
change deploy.yml code to version 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
FarrelAD committed Sep 18, 2024
1 parent 4b1d547 commit e0dd8b0
Showing 1 changed file with 16 additions and 23 deletions.
39 changes: 16 additions & 23 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Deploy static web 'Ngeblog' to GitHub pages
name: Deploy

on:
push:
branches: ['main']
branches:
- main

jobs:
build:
Expand All @@ -29,28 +30,20 @@ jobs:
path: ./dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
path: './dist'
name: production-files
path: ./dist

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

0 comments on commit e0dd8b0

Please sign in to comment.