forked from cccb-website-team/www
Update .forgejo/workflows/deploy.yaml
This commit is contained in:
parent
42f999443f
commit
43ae6bc869
1 changed files with 7 additions and 5 deletions
|
|
@ -21,10 +21,16 @@ jobs:
|
|||
git version
|
||||
hugo version
|
||||
python --version
|
||||
|
||||
- name: Set envionment vars
|
||||
run: |
|
||||
echo "GIT_BRANCH=${{ forgejo.event_name == 'schedule' && 'production' || forgejo.ref_name }}" >> "$FORGEJO_ENV"
|
||||
echo "SSH_PRIVATE_KEY=${{ env.GIT_BRANCH == 'production' && secrets.SSH_PRIVATE_KEY_PRODUCTION || secrets.SSH_PRIVATE_KEY_STAGING }}" >> "$FORGEJO_ENV"
|
||||
echo "DEPLOY_DIR=${{ env.GIT_BRANCH == 'production' && '/srv/http/www/' || '/srv/http/www-staging/' }}" >> "$FORGEJO_ENV"
|
||||
|
||||
- name: Checkout repository
|
||||
run: |
|
||||
git clone -b ${{ forgejo.ref_name }} --recursive https://git.berlin.ccc.de/cccb-website-team/www.git .
|
||||
git clone -b $GIT_BRANCH --recursive https://git.berlin.ccc.de/cccb-website-team/www.git .
|
||||
git status
|
||||
|
||||
- name: Install Python depenndencies
|
||||
|
|
@ -34,8 +40,6 @@ jobs:
|
|||
run: ./build.sh
|
||||
|
||||
- name: Setup SSH
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ forgejo.ref_name == 'production' && secrets.SSH_PRIVATE_KEY_PRODUCTION || secrets.SSH_PRIVATE_KEY_STAGING }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
printf "%s" "${{ secrets.KNOWN_HOSTS }}" | base64 -d > ~/.ssh/known_hosts
|
||||
|
|
@ -45,8 +49,6 @@ jobs:
|
|||
cat ~/.ssh/id_ed25519.pub
|
||||
|
||||
- name: Rsync rendered site
|
||||
env:
|
||||
DEPLOY_DIR: ${{ forgejo.ref_name == 'production' && '/srv/http/www/' || '/srv/http/www-staging/' }}
|
||||
# TODO: add --delete
|
||||
run: rsync -var -e 'ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=yes' ./public/ deploy@www.berlin.ccc.de:$DEPLOY_DIR
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue