.git folder is not transferred to Azure
- Dominant language
- TypeScript
- Stars
- 338
- Forks
- 234
- Avg merge
- 53m
- Merged PRs (30d)
- 3
Description
In order to use some versioning data from the .git folder during the app runtime, I want to be able to transfer (some parts of) the .git folder with the deployment, so that those files are available in the running container on Azure.
I've spent some time trying to debug this issue, and I can confirm the required .git directory and files are all present in the build container on GitHub, while the action is running. But at some point when the webapps-deploy@v2 action is running, these files do not appear to be transferred.
I've googled this extensively and looked through the documentation and I can's see any options that would allow me to explicitly include or exclude some files. It's possible that some stage of the Oryx build is removing the files, but I can't see any way to further debug this. On the deployed server I can SSH in and see the source code in /home/site/repository as well as in the /tmp/ folder which is default when opening the Azure webSSH client. Both have folders such as .github present, but neither have .git.
We are using a Python 3.10 runtime in a Linux container. The GitHub workflow is as follows.
```
on:
push:
branches:
- development
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: 'development'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- uses: actions/checkout@v3
with:
clean: false
- name: List all files
run: ls -al
- name: Set up Python version
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install PostGIS dependencies
run: sudo apt-get install -y binutils libproj-dev gdal-bin libgdal-dev python3-gdal
- name: Create and start virtual environment
run: |
python -m venv venv
source venv/bin/activate
# python dependencies
- name: Install dependencies
run: pip install -r requirements.txt
- name: collect static files
run: python manage.py collectstatic --noinput
# Deploy to Azure
- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v2
id: deploy-to-webapp
with:
app-name: 'epilepsy12-development'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_XXXXXXXX }}
package: .
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.