Force pushed the workflows back to Gitea
Some checks failed
Deploy Frontend / deploy (push) Failing after 13s
Some checks failed
Deploy Frontend / deploy (push) Failing after 13s
This commit is contained in:
43
.gitea/workflows/deploy.yml
Normal file
43
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Deploy Frontend
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, dev ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
SSH_HOST: ${{ secrets.SSH_HOST }} # e.g. psgbuild02.psg.net.au
|
||||
SSH_USER: ${{ secrets.SSH_USER }} # e.g. sonder
|
||||
SSH_KEY: ${{ secrets.SSH_KEY }} # your private key
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup SSH
|
||||
run: |
|
||||
install -m 0700 -d ~/.ssh
|
||||
echo "$SSH_KEY" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Pick environment
|
||||
id: envmap
|
||||
run: |
|
||||
if [[ "${{ gitea.ref_name }}" == "main" ]]; then
|
||||
echo "ENV=prod" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "ENV=dev" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Deploy via SSH
|
||||
run: |
|
||||
if [[ "${{ steps.envmap.outputs.ENV }}" == "prod" ]]; then
|
||||
ssh -i ~/.ssh/id_ed25519 ${SSH_USER}@${SSH_HOST} "/home/sonder/deploy-prod.sh"
|
||||
else
|
||||
ssh -i ~/.ssh/id_ed25519 ${SSH_USER}@${SSH_HOST} "/home/sonder/deploy-dev.sh"
|
||||
fi
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -40,4 +40,3 @@ yarn-error.log*
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
certificate (5).zip
|
||||
.gitea/workflows/deploy.yml
|
||||
|
||||
Reference in New Issue
Block a user