chore(app): Misc minor refinements #34
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: app-cicd | |
| on: | |
| push: | |
| paths: | |
| - app/** | |
| - .github/workflows/app.yaml | |
| permissions: | |
| contents: read # Needed to clone the repository | |
| # id-token: write # Needed for auth with Deno Deploy | |
| # id-token currently not needed due to using deployctl cli instead of github action due to missing features in the action | |
| defaults: | |
| run: | |
| working-directory: app | |
| jobs: | |
| deploy_dev: | |
| runs-on: ubuntu-latest | |
| environment: Development | |
| env: | |
| APP_HOST: https://dev.stellerom.no | |
| ROOM_API_URL: https://room-api-dev.stellerom.no | |
| REVIEW_API_URL: https://review-api-dev.stellerom.no | |
| AZURE_ADB2C_CLIENT_ID: ${{ vars.AZURE_ADB2C_CLIENT_ID }} | |
| AZURE_ADB2C_CLIENT_SECRET: ${{ secrets.AZURE_ADB2C_CLIENT_SECRET }} | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v4 | |
| - name: Install Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Prepare .env file | |
| run: cat .env.template | envsubst > .env | |
| - name: Build | |
| run: deno task build | |
| - name: Install deployment tool | |
| run: deno install -gArf jsr:@deno/deployctl | |
| - name: Deploy | |
| run: | | |
| deployctl deploy --prod --project=stellerom-dev --entrypoint=main.ts --env-file=.env \ | |
| --env AZURE_ADB2C_POLICY="/" | |
| # ^ AZURE_ADB2C_POLICY should preferably be empty, but need to give it a value to avoid getRequiredEnv failure | |
| env: | |
| DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }} | |
| deploy_prod: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: deploy_dev | |
| runs-on: ubuntu-latest | |
| environment: Production | |
| env: | |
| APP_HOST: https://www.stellerom.no | |
| ROOM_API_URL: https://room-api-prod.stellerom.no | |
| REVIEW_API_URL: https://review-api-prod.stellerom.no | |
| AZURE_ADB2C_CLIENT_ID: ${{ vars.AZURE_ADB2C_CLIENT_ID }} | |
| AZURE_ADB2C_CLIENT_SECRET: ${{ secrets.AZURE_ADB2C_CLIENT_SECRET }} | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v4 | |
| - name: Install Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Prepare .env file | |
| run: cat .env.template | envsubst > .env | |
| - name: Build | |
| run: deno task build | |
| - name: Install deployment tool | |
| run: deno install -gArf jsr:@deno/deployctl | |
| - name: Deploy | |
| run: | | |
| deployctl deploy --prod --project=christianfosli-stellerom --entrypoint=main.ts --env-file=.env \ | |
| --env AZURE_ADB2C_POLICY="/" | |
| # ^ AZURE_ADB2C_POLICY should preferably be empty, but need to give it a value to avoid getRequiredEnv failure | |
| env: | |
| DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }} | |