fix: package.json private/keywords修正 + Cargo.lock追跡開始 #19
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: Build and Deploy to GCE | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ghcr.io/kako-jun/sid-note:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Delete old container images | |
| uses: actions/delete-package-versions@v5 | |
| with: | |
| package-name: 'sid-note' | |
| package-type: 'container' | |
| min-versions-to-keep: 5 | |
| delete-only-untagged-versions: false | |
| continue-on-error: true | |
| - name: Deploy to GCE | |
| uses: appleboy/ssh-action@v1.1.0 | |
| with: | |
| host: 35.197.65.57 | |
| username: ${{ secrets.GCE_USERNAME }} | |
| key: ${{ secrets.GCE_SSH_KEY }} | |
| command_timeout: 5m | |
| script: | | |
| cd ~/repos/sid-note | |
| git pull origin main | |
| # 新しいイメージをpull | |
| docker pull ghcr.io/kako-jun/sid-note:latest | |
| # ネットワークを事前作成(既存の場合は無視) | |
| docker network create proxy-network 2>/dev/null || true | |
| # Docker Composeでアプリを再デプロイ | |
| docker compose up -d | |
| # 不要なDockerリソースをクリーンアップ | |
| docker image prune -f | |
| docker container prune -f |