Skip to content

chore: tf state

chore: tf state #182

Workflow file for this run

name: store-on-wheels-dev
concurrency:
group: store-on-wheels-dev
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v4
- name: Setup .NET 8x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install .NET Dependencies
run: dotnet restore
- name: Install npm modules
run: |
cd src/storeonwheels.client
npm ci
- name: Build JS
run: |
cd src/storeonwheels.client
npm run build
- name: Build .NET
run: dotnet build
- name: Test with the dotnet CLI
run: dotnet test
- name: Test JS
run: |
cd src/storeonwheels.client
npm run test-ci
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout current branch
uses: actions/checkout@v4
- name: Setup .NET 8x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Regnerate Sqlite DB
run: make renegerate-sqlite
- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Validate Azure CLI can be used
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
az account show
- name: Terraform validate
run: |
cd infra/Terraform
terraform init
terraform validate
- name: Terraform plan
run: |
cd infra/Terraform
terraform plan
# Apply step can be skipped for pull requests
- name: Terraform apply
if: github.ref == 'refs/heads/main'
run: cd infra/Terraform && terraform apply -auto-approve