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: Copy environment variables to Heroku app | |
if: github.event.action == 'opened' | |
run: | | |
heroku config --shell --app=my-development-app > .env | |
cat .env | tr '\n' ' ' | xargs heroku config:set --app=${{ env.HEROKU_APP_NAME }} |
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: Add Heroku app to pipeline | |
if: github.event.action == 'opened' | |
run: heroku pipelines:add my-pipeline --app=${{ env.HEROKU_APP_NAME }} --stage=development |
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: Create Heroku app | |
if: github.event.action == 'opened' | |
run: heroku apps:create ${{ env.HEROKU_APP_NAME }} |
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: Login to Heroku | |
uses: akhileshns/heroku-deploy@v3.12.12 | |
with: | |
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | |
heroku_email: user@example.com | |
heroku_app_name: ${{ env.HEROKU_APP_NAME }} | |
justlogin: true |
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: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.head_ref }} |
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
jobs: | |
heroku-pull-request: | |
runs-on: ubuntu-latest | |
env: | |
HEROKU_APP_NAME: my-app-pr-${{ github.event.number }} | |
steps: | |
# ... |
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: Heroku Pull Request | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, closed] |
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: Heroku Pull Request | |
on: pull_request |
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
# shut down redis-server (if applicable) | |
REDIS_SERVER_PID_FILE=/tmp/redis-server.pid | |
(kill $(cat $REDIS_SERVER_PID_FILE) 2>&1) >/dev/null | |
sleep 0.1 | |
# start redis-server | |
nohup redis-server redis.conf >/dev/null 2>&1 & | |
sleep 0.1 | |
echo $! > $REDIS_SERVER_PID_FILE |
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
const stream = redis.scanStream({ match: '*' }); | |
let keys = []; | |
stream.on('data', (resultKeys) => { | |
keys = keys.concat(resultKeys); | |
}); | |
stream.on('end', () => { | |
console.log(keys); // returns ['key'] |