Skip to content

chore(deps): update babel monorepo #410

chore(deps): update babel monorepo

chore(deps): update babel monorepo #410

Workflow file for this run

name: Ship To Prod 🚀
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Create `.env` File
uses: SpicyPizza/create-envfile@1.1
with:
file_name: .env
github_workspace: ${{ github.workspace }}
envkey_TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
envkey_TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
envkey_TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
envkey_TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
envkey_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
envkey_FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }}
envkey_FIREBASE_DATABASE_URL: ${{ secrets.FIREBASE_DATABASE_URL }}
envkey_FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
envkey_FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
envkey_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
envkey_FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
envkey_FIREBASE_MEASUREMENT_ID: ${{ secrets.FIREBASE_MEASUREMENT_ID }}
envkey_DOMAIN_NAME: ${{ secrets.DOMAIN_NAME }}
envkey_RECURSION_DEPTH_LIMIT: ${{ secrets.RECURSION_DEPTH_LIMIT }}
- name: Run Tests
run: yarn test
- name: Login To DockerHub
uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set Up QEMU
uses: docker/setup-qemu-action@v1
if: ${{ github.event_name != 'pull_request' }}
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v1
if: ${{ github.event_name != 'pull_request' }}
- name: Docker Build And Push
uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
push: ${{ github.event_name != 'pull_request' }}
tags: iamskok/twitter-bot
- name: Execute Remote SSH Commands
uses: appleboy/ssh-action@master
if: ${{ github.event_name != 'pull_request' }}
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
args: >
--script 'docker stop $(docker ps -aq)'
--script 'docker system prune -a -f'
--script 'cd /home/twitter-bot'
--script 'docker pull iamskok/twitter-bot'
--script 'nohup docker run --env-file .env -v ${PWD}/service-account:/app/service-account -v ${PWD}/logs:/app/logs iamskok/twitter-bot > docker.output 2> docker.error < /dev/null &'