From 5b400f258d9acca980dd021998339db3c18d8dee Mon Sep 17 00:00:00 2001 From: Shirley Fang Date: Sun, 22 Oct 2023 18:10:59 -0400 Subject: [PATCH] Set up Github Actions to deploy to development --- .github/workflows/deploy_development.yml | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/deploy_development.yml diff --git a/.github/workflows/deploy_development.yml b/.github/workflows/deploy_development.yml new file mode 100644 index 0000000..cb54f55 --- /dev/null +++ b/.github/workflows/deploy_development.yml @@ -0,0 +1,41 @@ +name: Deploy to Development + +on: + push: + branches: [ development ] + +jobs: + deploy: + name: Deploy Process + runs-on: ubuntu-latest + environment: development + steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Set up Node.js 18.x: + uses: actions/setup-node@v3 + with: + node-version: 18.x + - name: Install Dependencies + run: corepack enable && yarn install + - name: Run unit tests + run: yarn test + - name: Build + run: yarn build + - name: Generate .env file + run: | + touch ./dist/.env + echo GOOGLE_ACCOUNT_CLIENT=${{ secrets.GOOGLE_ACCOUNT_CLIENT }} >> .env + echo GOOGLE_ACCOUNT_SECRET=${{ secrets.GOOGLE_ACCOUNT_SECRET }} >> .env + echo GOOGLE_ACCOUNT_TOKEN=${{ secrets.GOOGLE_ACCOUNT_TOKEN }} >> .env + echo SLACK_APP_TOKEN=${{ secrets.SLACK_APP_TOKEN }} >> .env + echo SLACK_OAUTH_TOKEN=${{ secrets.SLACK_OAUTH_TOKEN }} >> .env + echo SLACK_SIGNING_SECRET=${{ secrets.SLACK_SIGNING_SECRET }} >> .env + - name: Copy files to server + uses: appleboy/scp-action@master + with: + host: ${{ secrets.REMOTE_HOST }} + username: ${{ secrets.REMOTE_USER }} + key: ${{ secrets.REMOTE_KEY }} + source: dist + target: ~/minerva-dev/ \ No newline at end of file