chore: tf state #172
Workflow file for this run
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: 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 | |
run: az --version | |
- name: Terraform validate and plan | |
run: | | |
cd infra/Terraform | |
terraform init | |
terraform validate | |
# 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 |