Skip to content

Commit

Permalink
add: デプロイ方法をGithub Workflowに変更 (#237)
Browse files Browse the repository at this point in the history
Hiroshiba authored Dec 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent da15d51 commit 7de4b1f
Showing 4 changed files with 37 additions and 125 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and deploy

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup-environment

- name: Build
run: pnpm run build

- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist/

deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -23,9 +23,7 @@ pnpm start

## deploy

```bash
pnpm run deploy
```
Github Workflowの`build-and-deploy.yml``workflow_dispatch`してデプロイします。

### プレビュー版

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
"preview": "astro preview",
"preview-build": "cross-env PREVIEW=1 astro build",
"test-build": "cross-env TEST=1 astro build",
"deploy": "astro check && astro build && gh-pages -d dist",
"lint": "astro check && eslint src/ && prettier --check src/",
"fmt": "eslint src/ --fix && prettier --write src/",
"test:e2e": "cross-env TEST=1 playwright test",
@@ -47,7 +46,6 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-astro": "^1.3.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"gh-pages": "^6.2.0",
"nanostores": "^0.11.3",
"playwright": "^1.49.0",
"prettier": "^3.4.2",
120 changes: 0 additions & 120 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7de4b1f

Please sign in to comment.