Github actions #54
Workflow file for this run
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: test gha | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
permissions: | ||
id-token: write | ||
contents: read | ||
jobs: | ||
deploy-infrastructure: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: azure/login@v2 | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
- name: Setup Terraform with specified version on the runner | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: 1.8.3 | ||
- name: Dump backend config | ||
run: echo "${{TF_BACKEND_CONFIG}}" > backend.hcl | ||
Check failure on line 28 in .github/workflows/main.yml
|
||
- name: Terraform init | ||
run: terraform init -backend-config=backend.hcl | ||
- name: Terraform apply | ||
run: terraform apply -auto-approve -var "create_vm=true" -var "create_app_service=true" | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install libvips | ||
run: sudo apt-get install -y libvips | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.1.6" | ||
bundler-cache: true | ||
- name: Tests | ||
env: | ||
AZURE_ACCOUNT_NAME: ${{secrets.AZURE_ACCOUNT_NAME}} | ||
AZURE_ACCESS_KEY: ${{secrets.AZURE_ACCESS_KEY}} | ||
AZURE_PRIVATE_CONTAINER: ${{secrets.AZURE_PRIVATE_CONTAINER}} | ||
AZURE_PUBLIC_CONTAINER: ${{secrets.AZURE_PUBLIC_CONTAINER}} | ||
AZURE_PRINCIPAL_ID: ${{secrets.AZURE_PRINCIPAL_ID}} | ||
run: bundle exec rake test |