Skip to content

Commit

Permalink
Add deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
satler-git committed Jul 9, 2024
1 parent e2d506a commit 3c84c31
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy to Cloudflare pages

on:
push:
branches: [ "main" ]

workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18.4.0
cache: 'npm'

- name: Minify css
run: |
npm install -g clean-css-cli
cleancss resource/suCSS/reset.css --output static/css/reset-min.css
cleancss resource/suCSS/suCSS.css --output static/css/suCSS-min.css
- name: Install zola
uses: taiki-e/install-action@v2
with:
tool: zola@0.19.1

- name: Build with zola
run: zola build

- run: npm test

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: satler-dev
directory: ./public
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 3c84c31

Please sign in to comment.