ftp upload #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ftp upload | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [update_content] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: contains(github.event.head_commit.message, '[skip ci]') == false | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: 📸 Calculate commit hash | |
| id: sha | |
| uses: pr-mpt/actions-commit-hash@v2 | |
| - name: 🔨 Prepare Node environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: 🎉 Install project dependencies | |
| run: npm install | |
| - name: 🔧 Create empty mocks | |
| run: npm run create-empty-mocks | |
| - name: 🏗️ Build app | |
| run: npm run build | |
| env: | |
| PUBLIC_MICROCMS_SERVICE_DOMAIN: ${{ secrets.PUBLIC_MICROCMS_SERVICE_DOMAIN }} | |
| PUBLIC_MICROCMS_API_KEY: ${{ secrets.PUBLIC_MICROCMS_API_KEY }} | |
| - name: ✅ Check code format/style | |
| run: npm run test | |
| - name: 📂 Sync files | |
| uses: SamKirkland/FTP-Deploy-Action@4.0.0 | |
| with: | |
| server: ${{ secrets.FTP_SERVER }} | |
| username: ${{ secrets.FTP_USERNAME }} | |
| password: ${{ secrets.FTP_PASSWARD }} | |
| local-dir: ./dist/ | |
| server-dir: /home/${{ secrets.FTP_USERNAME }}/www/misc-mdn/ | |
| dangerous-clean-slate: true # クリーンアップのために全てのファイルを削除する |