remove auth cache from settings #142
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: Continuous Deployment | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [labeled] | |
jobs: | |
staging_deploy: | |
if: (github.event_name != 'pull_request') || (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'deploy') | |
runs-on: ubuntu-latest | |
environment: Staging | |
steps: | |
- uses: actions/checkout@v2 | |
- name: push to dockerhub | |
uses: fylein/docker-release-action@master | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
IMAGE_NAME: fyle_integration_settings-api | |
- name: Install kustomize | |
run: | | |
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash | |
sudo mv kustomize /usr/local/bin/ | |
- name: Clone another repository | |
uses: actions/checkout@v2 | |
with: | |
repository: ${{ secrets.STAGING_DEPLOY_REPO }} | |
ref: master | |
path: ${{ secrets.STAGING_DEPLOY_REPO }} | |
persist-credentials: false | |
token: ${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }} | |
- name: Update Image Tag | |
run: | | |
NEW_TAG="v$(git rev-parse --short HEAD)" | |
cd ${{ secrets.STAGING_DEPLOY_REPO }}/${{ secrets.EKS_CLUSTER_NAME }}/integrations | |
kustomize edit set image docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_integration_settings-api=docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_integration_settings-api:$NEW_TAG | |
- name: Commit and push changes | |
run: | | |
cd ${{ secrets.STAGING_DEPLOY_REPO }}/ | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git add . | |
git commit -m "Update image tag" | |
git remote set-url origin https://x-access-token:${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }}@github.com/${{ secrets.STAGING_DEPLOY_REPO }} | |
git pull origin master | |
git push origin master | |
- name: Create new Sentry release | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: fyle-technologies-private-limi | |
SENTRY_PROJECT: integrations-settings-api | |
SENTRY_DEPLOY_ENVIRONMENT: staging | |
run: | | |
# Install Sentry CLI | |
curl -sL https://sentry.io/get-cli/ | bash | |
# Create new Sentry release | |
export SENTRY_RELEASE=$(sentry-cli releases propose-version) | |
sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE | |
sentry-cli releases set-commits --auto $SENTRY_RELEASE | |
sentry-cli releases finalize $SENTRY_RELEASE | |
# Create new deploy for this Sentry release | |
sentry-cli releases deploys $SENTRY_RELEASE new -e $SENTRY_DEPLOY_ENVIRONMENT |