Add gcp runner #1
This file contains 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: Deploy to Heroku | |
on: | |
push: | |
paths: | |
- bun.lockb | |
- package.json | |
- Dockerfile | |
- .github/workflows/gcp.yaml | |
- api/** | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: "${{ secrets.SERVICE_ACCOUNT_KEY }}" | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Docker auth | |
run: |- | |
gcloud auth configure-docker us-central1-docker.pkg.dev | |
- name: Set environment variables | |
run: | | |
touch .env | |
echo "TURSO_DATABASE_URL=${{ secrets.TURSO_DATABASE_URL }}" >> .env | |
echo "TURSO_AUTH_TOKEN=${{ secrets.TURSO_AUTH_TOKEN }}" >> .env | |
# echo "ELYSIA_API_PORT=80" >> .env | |
- name: Build Docker image | |
run: docker build -t us-central1-docker.pkg.dev/classified-ink/classified-ink/api:latest . | |
- name: Build image | |
run: docker push us-central1-docker.pkg.dev/classified-ink/classified-ink/api:latest |