Updated pipeline with azure authentication via service principal and … #6
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: Build and Deploy | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Cache Cargo dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install musl-tools | |
run: sudo apt install musl-tools | |
- name: Add musl target | |
run: rustup target add x86_64-unknown-linux-musl | |
- name: Build | |
run: cargo build --release --target=x86_64-unknown-linux-musl | |
- name: Install Azure Functions Core Tools | |
run: | | |
sudo apt-get install azure-functions-core-tools-3 | |
func --version | |
- name: Publish to Azure Function App | |
run: func azure functionapp publish hvalfangstlinuxfunctionapp --custom | |
env: | |
AZURE_FUNCTIONAPP_NAME: hvalfangstlinuxfunctionapp |