Skip to content

Commit

Permalink
fix: fix and improve deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Blumendorf committed Jan 5, 2025
1 parent aba5f43 commit fc1786a
Showing 1 changed file with 37 additions and 34 deletions.
71 changes: 37 additions & 34 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,28 @@ permissions:
id-token: write

jobs:
build:
create-release:
runs-on: ubuntu-latest
name: Create Release
permissions:
contents: write
steps:
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: release-v${{ github.run_number }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: false

build-and-deploy:
runs-on: ubuntu-latest
name: GitHub Pages - Build and Deploy
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -41,54 +61,37 @@ jobs:
with:
path: './dist'


create-release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: release-v${{ github.run_number }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: false

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@v4

ftp-deploy:
needs: build
runs-on: ubuntu-latest
name: FTP - Build and Deploy
steps:
- uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
name: github-pages
path: artifact
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Extract artifact
run: tar -xf artifact/artifact.tar -C artifact
- name: Build for FTP
run: pnpm build --base=/

- name: Deploy to FTP
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: artifact/
protocol: ftps
local-dir: dist/

0 comments on commit fc1786a

Please sign in to comment.