Try sync #3
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: Copy files | |
on: | |
push: | |
branches: ["main", "source"] | |
workflow_dispatch: | |
permissions: | |
id-token: write # Require write permission to Fetch an OIDC token. | |
jobs: | |
copy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Azure CLI 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: Install azcopy | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget | |
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb | |
sudo dpkg -i packages-microsoft-prod.deb | |
sudo apt-get update | |
sudo apt-get install -y azcopy | |
rm -f packages-microsoft-prod.deb | |
- name: Create file | |
run: | | |
echo "Hello, world!" > hello.txt | |
- name: Copy file to Azure Blob Storage | |
env: | |
AZURE_STORAGE_ACCOUNT: asdsajkldhsahdhljkasdcc # your-storage-account-name | |
AZURE_CONTAINER_NAME: example | |
AZCOPY_AUTO_LOGIN_TYPE: AZCLI | |
AZCOPY_TENANT_ID: 531ff96d-0ae9-462a-8d2d-bec7c0b42082 | |
run: | | |
echo $AZCOPY_TENANT_ID | |
azcopy sync --compare-hash=md5 \ | |
--delete-destination=true \ | |
--include-pattern="*.txt" \ | |
"." "https://$AZURE_STORAGE_ACCOUNT.blob.core.windows.net/$AZURE_CONTAINER_NAME/" |