-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.43 KB
/
gha-ubuntu-azcopy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: AzCopy Ubuntu Agent
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
env:
rgName: rg-tf-state102-uat02
storageAccount: sttfstate259
container: azcopyghaubuntu
jobs:
gha-ubuntu-azcopy:
name: AzCopy Ubuntu Agent
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Az Copy Test
continue-on-error: true
shell: pwsh
run: |
$Date = (Get-Date).AddDays(1).ToString('yyyy-MM-dd')
$key = $( az storage account keys list --resource-group ${{ env.rgName }} --account-name ${{ env.storageAccount }} --query [0].value -o tsv )
az storage container create --name ${{ env.container }} --account-name ${{ env.storageAccount }} --account-key "$key"
$sas = $( az storage container generate-sas --name ${{ env.container }} --expiry $Date --permissions "racwdli" --account-name ${{ env.storageAccount }} --account-key "$key" ).Replace("`"","")
azcopy copy "./seed_images/*" "https://${{ env. storageAccount }}.blob.core.windows.net/${{ env.container }}/from_gha_cli?$sas" --recursive=true
- name: Get log
working-directory: /home/runner/.azcopy
run: |
cat *.log