I'm trying to push the previous commit into GitHub tags for rollback I'm not able to store the previous commit, my code is pushing the latest commit to the github tags
User name: Deploy to Azure Storage Account
on: workflow_dispatch:
jobs: deploy: runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Update Azure CLI
run: |
sudo apt-get install -y azure-cli
- name: Set up Azure CLI
run: |
npm ci
- name: Clear npm cache
run: npm cache clean --force
- name: Log in to Azure
run: |
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Set Git user identity
run: |
git config --global user.email ""
git config --global user.name "Karandeep Singh"
- name: Store previous commit into tag
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
TAG_NAME="previous-commit-${GITHUB_RUN_NUMBER}"
git tag -a $TAG_NAME $PREVIOUS_COMMIT -m "Tagging previous commit for run $GITHUB_RUN_NUMBER"
git push origin $TAG_NAME --follow-tags
- name: Set up environment variables
run: |
touch .env
echo "REACT_APP=testing1" > .env
echo "REACT_APP_API_HOST=" >> .env
echo "REACT_APP_AUTH_HOST=" >> .env
echo REACT_APP="testing" >> .env
npm run build
- name: Deploy to Azure Storage Account
run: |
az storage blob upload-batch --account-name ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} --destination \$web --source ./build --debug --overwrite