-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
# hyperskill-azure-login | ||
Hyperskill GitHub Action | Azure Install and login | ||
|
||
```yaml | ||
- uses: actions/hyperskill-azure-login@v1 | ||
with: | ||
client_id: ${{ secrets.CLIENT_ID }} | ||
client_secret: ${{ secrets.CLIENT_SECRET }} | ||
subscription_id: ${{ secrets.SUBSCRIPTION_ID }} | ||
tenant_id: ${{ secrets.TENANT_ID }} | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: 'Login to Azure' | ||
description: 'Install azure cli and login to Azure' | ||
|
||
inputs: | ||
client_id: | ||
required: true | ||
description: Azure client id | ||
client_secret: | ||
required: true | ||
description: Azure client secret | ||
subscription_id: | ||
required: true | ||
description: Azure subscription id | ||
tenant_id: | ||
required: true | ||
description: Azure tenant id | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install Azure cli | ||
run: | | ||
sudo apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
apt-transport-https \ | ||
lsb-release \ | ||
gnupg \ | ||
software-properties-common | ||
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null | ||
AZ_REPO=$(lsb_release -cs) | ||
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
azure-cli | ||
shell: bash | ||
|
||
- name: Azure Login | ||
uses: azure/login@v1 | ||
with: | ||
creds: '{"clientId":"${{ inputs.client_id }}","clientSecret":"${{ inputs.client_secret }}","subscriptionId":"${{ inputs.subscription_id }}","tenantId":"${{ inputs.tenant_id }}"}' |