automate the build #2
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: Continuous Deployment | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| Deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build app | |
| run: npm run build | |
| - name: Authenticate to GCP | |
| uses: google-github-actions/setup-gcloud@v3 | |
| with: | |
| project_id: notely-477105 | |
| service_account_key: ${{ secrets.GCP_CREDENTIALS }} | |
| - name: Verify gcloud | |
| run: gcloud info | |
| - name: Build and push image to Artifact Registry | |
| run: gcloud builds submit --tag us-central1-docker.pkg.dev/notely-477105/notely-repo/notely-app:latest . |