Skip to content

Commit

Permalink
Change yaml for GithubPages
Browse files Browse the repository at this point in the history
Update pipeline script to publish directly dist to GithubPage (instead of sftp server)
  • Loading branch information
jano42 authored Sep 19, 2024
1 parent 0ecd118 commit 0376600
Showing 1 changed file with 39 additions and 17 deletions.
56 changes: 39 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
name: Build and Publish yadoms Website

on:
# Runs on pushes targeting the default branch
push:
branches:
- main
branches: ["main"]
pull_request:
branches:
- main
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
name: Deploy
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
Expand All @@ -20,13 +36,19 @@ jobs:
run: |
npm ci
npm run build
- name: List output files
run: ls

- name: Upload ftp
uses: sebastianpopp/ftp-action@releases/v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
host: ${{ secrets.FTP_SERVER }}
user: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
localDir: 'dist/'
path: dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 0376600

Please sign in to comment.