this repo has no description

CI/CD

astrra.space 2a33061a 686ef007

verified
Changed files
+44
.forgejo
workflows
+44
.forgejo/workflows/deploy.yaml
··· 1 + name: Deploy 2 + 3 + on: 4 + push: 5 + branches: 6 + - main 7 + 8 + jobs: 9 + deploy: 10 + name: Deploy 11 + runs-on: ubuntu-latest 12 + 13 + steps: 14 + - name: Checkout repo 15 + uses: actions/checkout@v4 16 + 17 + - name: Setup Node 18 + uses: actions/setup-node@v3 19 + 20 + - name: Install dependencies 21 + uses: bahmutov/npm-install@v1 22 + 23 + - name: Build project 24 + run: npm run build 25 + 26 + - name: Setup SCP 27 + run: | 28 + mkdir -p ~/.ssh 29 + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 30 + chmod -R go-rwx ~/.ssh 31 + ssh-keyscan -H ${{ vars.SERVER_HOST }} >> ~/.ssh/known_hosts 32 + echo "Deploying to ${{ vars.SERVER_HOST }} as ${{ vars.SERVER_USER }} to /home/common/www/${{ github.ref_name }}" 33 + 34 + - name: Debug SSH Connection 35 + run: ssh -v -o PasswordAuthentication=no -i ~/.ssh/id_ed25519 ${{ vars.SERVER_USER }}@${{ vars.SERVER_HOST }} echo "SSH Connection Successful" 36 + 37 + - name: create folder if not exists 38 + run: | 39 + ssh -i ~/.ssh/id_ed25519 ${{ vars.SERVER_USER }}@${{ vars.SERVER_HOST }} "mkdir -p /var/www/pds/${{ github.ref_name }}" 40 + 41 + - name: Deploy via SCP 42 + run: | 43 + scp -i ~/.ssh/id_ed25519 -rv ./dist/* ${{ vars.SERVER_USER }}@\[${{ vars.SERVER_HOST }}\]:/var/www/pds/${{ github.ref_name }} 44 +