Bump django from 3.1.14 to 4.2.16 #39
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: Deploy to Staging | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [labeled] | |
jobs: | |
slack_app_deploy: | |
if: (github.event_name != 'pull_request') || (github.event_name == 'pull_request' && github.event.action == 'labeled') | |
runs-on: ubuntu-latest | |
environment: Staging | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: satackey/action-docker-layer-caching@v0.0.11 | |
continue-on-error: true | |
- name: push to dockerhub | |
uses: fylein/docker-release-action@master | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} | |
IMAGE_NAME: fyle_slack-app | |
- 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: ${{ vars.STAGING_DEPLOY_REPO }} | |
ref: master | |
path: ${{ vars.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 ${{ vars.STAGING_DEPLOY_REPO }}/${{ vars.STAGING_DEPLOY_DIR }}/staging/integrations | |
kustomize edit set image docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_slack-app=docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_slack-app:$NEW_TAG | |
- name: Commit and push changes | |
run: | | |
cd ${{ vars.STAGING_DEPLOY_REPO }}/ | |
git config --global user.email "integrations@fylehq.com" | |
git config --global user.name "GitHub Actions" | |
git add . | |
git commit -m "Deployed slack-app:$NEW_TAG to staging" | |
git remote set-url origin https://x-access-token:${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }}@github.com/${{ vars.STAGING_DEPLOY_REPO }} | |
git push origin master |