Skip to content

Commit

Permalink
Merge pull request #1256 from devinit/fix/dev-deploy-to-live
Browse files Browse the repository at this point in the history
Only use production vars for master branch or non-beta release
  • Loading branch information
akmiller01 authored Nov 9, 2022
2 parents 575516e + b9b443d commit 4143c5a
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/deploy_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- develop
- master
tags:
- '*-beta*'
- 'v[0-9]+.[0-9]+.[0-9]+'
Expand Down Expand Up @@ -34,6 +33,16 @@ jobs:
if: ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+.[0-9]+.[0-9]
run: echo "TAG=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_ENV
- name: Set env for production if release and not beta
if: startsWith(github.ref, 'refs/tags/v') && ( contains(env.TAG, '-beta') != true )
run: |
echo "ENVIRONMENT=${{ secrets.PROD_ENV }}" >> $GITHUB_ENV
echo "HOST=${{ secrets.PROD_HOST }}" >> $GITHUB_ENV
echo "USERNAME=${{ secrets.USERNAME }}" >> $GITHUB_ENV
echo "WWW_SITE_URL=www.devinit.org" >> $GITHUB_ENV
echo "SITE_URL=devinit.org" >> $GITHUB_ENV
echo "DATA_SITE_URL=data.devinit.org" >> $GITHUB_ENV
- name: Set env for staging or dev
if: endsWith(github.ref, '/develop') || contains(env.TAG, '-beta')
run: |
Expand All @@ -44,16 +53,6 @@ jobs:
echo "SITE_URL=dev.devinit.org" >> $GITHUB_ENV
echo "DATA_SITE_URL=dev.devinit.org" >> $GITHUB_ENV
- name: Set env for production
if: endsWith(github.ref, '/master') || contains(env.TAG, '-beta') != true
run: |
echo "ENVIRONMENT=${{ secrets.PROD_ENV }}" >> $GITHUB_ENV
echo "HOST=${{ secrets.PROD_HOST }}" >> $GITHUB_ENV
echo "USERNAME=${{ secrets.USERNAME }}" >> $GITHUB_ENV
echo "WWW_SITE_URL=www.devinit.org" >> $GITHUB_ENV
echo "SITE_URL=devinit.org" >> $GITHUB_ENV
echo "DATA_SITE_URL=data.devinit.org" >> $GITHUB_ENV
- name: copy deploy file via ssh
uses: appleboy/scp-action@master
env:
Expand Down

0 comments on commit 4143c5a

Please sign in to comment.