diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 97213e5..945a55f 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -8,8 +8,9 @@ on: required: true type: string default: "development" + jobs: - deploy: + build: runs-on: ubuntu-latest steps: @@ -18,18 +19,30 @@ jobs: with: ref: ${{ github.event.inputs.branch }} - - name: Setup SSH - uses: webfactory/ssh-agent@v0.9.0 + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push Client Docker Image + uses: docker/build-push-action@v5 + with: + context: ./client + push: true + tags: | + 7cav/apps_beta_client:${{ github.sha }} + 7cav/apps_beta_client:latest + + - name: Build and Push Server Docker Image + uses: docker/build-push-action@v5 with: - ssh-private-key: ${{ secrets.THE_KEY }} + context: ./server + push: true + tags: | + 7cav/apps_beta_server:${{ github.sha }} + 7cav/apps_beta_server:latest - - name: Deploy to Server + - name: Force Watchtower Update run: | - ssh -o StrictHostKeyChecking=no thehub@traycer.7cav.us << 'EOF' - cd /etc/compose/apps-beta/adr - git fetch origin - git reset --hard origin/${{ github.event.inputs.branch }} - cd /etc/compose/apps-beta/ - docker compose down - docker compose up -d - EOF + curl -H "Authorization: Bearer ${{ secrets.WATCHER_KEY }}" https://watcher.7cav.us/v1/update \ No newline at end of file diff --git a/.github/workflows/old_dev_deploy.yml b/.github/workflows/old_dev_deploy.yml new file mode 100644 index 0000000..2a092fe --- /dev/null +++ b/.github/workflows/old_dev_deploy.yml @@ -0,0 +1,35 @@ +name: (DO NOT USE)Old Development Deploy + +on: + workflow_dispatch: + inputs: + branch: + description: "Branch to deploy" + required: true + type: string + default: "development" +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch }} + + - name: Setup SSH + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.THE_KEY }} + + - name: Deploy to Server + run: | + ssh -o StrictHostKeyChecking=no thehub@traycer.7cav.us << 'EOF' + cd /etc/compose/apps-beta/adr + git fetch origin + git reset --hard origin/${{ github.event.inputs.branch }} + cd /etc/compose/apps-beta/ + docker compose down + docker compose up -d + EOF