v up #2065
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: Upload Dev zip | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| jobs: | |
| release: | |
| if: github.event.repository.fork == false && github.event_name == 'push' | |
| name: Upload to Azure | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the repository | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| # Create version.json with version and commit hash | |
| - name: Create version.json | |
| run: | | |
| VERSION=$(cat version_latest.txt | tr -d '[:space:]') | |
| SHORT_SHA="${GITHUB_SHA::7}" | |
| echo "{\"version\": \"${VERSION}\", \"commit\": \"${SHORT_SHA}\"}" > version.json | |
| # Create ZIP File in a New Source Directory | |
| - name: Prepare and Zip Release Files | |
| run: | | |
| mkdir -p src/releases | |
| zip -r src/releases/dev.zip . \ | |
| --exclude "./src/releases/*" \ | |
| --exclude ".*" \ | |
| --exclude ".*/**" | |
| # Upload to Azure Blob Storage | |
| - name: Azure Blob Upload with Destination folder defined | |
| uses: LanceMcCarthy/Action-AzureBlobUpload@v3.3.0 | |
| with: | |
| connection_string: ${{ secrets.AZURE_CONNECTION_STRING }} | |
| container_name: cipp-api | |
| source_folder: src/releases/ | |
| destination_folder: / | |
| delete_if_exists: true |