feat: Improved deployment mechanism
This commit is contained in:
parent
5f64e9cef5
commit
bea682e93a
4 changed files with 56 additions and 4 deletions
|
@ -24,6 +24,19 @@ jobs:
|
|||
- name: Generate static site
|
||||
run: python3 main.py --theme dark --domains dark.private.coffee
|
||||
|
||||
- name: Set up SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan -t ed25519 git.private.coffee >> ~/.ssh/known_hosts
|
||||
|
||||
# Create SSH config file to ensure the correct identity file is used
|
||||
echo "Host git.private.coffee" > ~/.ssh/config
|
||||
echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config
|
||||
echo " IdentitiesOnly yes" >> ~/.ssh/config
|
||||
chmod 600 ~/.ssh/config
|
||||
|
||||
- name: Deploy to pages-dark branch
|
||||
run: |
|
||||
# Configure Git
|
||||
|
@ -49,7 +62,7 @@ jobs:
|
|||
git commit -m "Deploy static site"
|
||||
|
||||
# Set the URL again
|
||||
git remote set-url origin "https://${{ secrets.FORGEJO_USER }}:${{ secrets.FORGEJO_TOKEN }}@git.private.coffee/PrivateCoffee/privatecoffee-website.git"
|
||||
git remote set-url origin "git@git.private.coffee:PrivateCoffee/privatecoffee-website.git"
|
||||
|
||||
# Force push to the 'pages-dark' branch
|
||||
git push origin pages-dark --force
|
||||
|
|
|
@ -26,6 +26,19 @@ jobs:
|
|||
- name: Generate static site
|
||||
run: python3 main.py --dev --domains dev.private.coffee
|
||||
|
||||
- name: Set up SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan -t ed25519 git.private.coffee >> ~/.ssh/known_hosts
|
||||
|
||||
# Create SSH config file to ensure the correct identity file is used
|
||||
echo "Host git.private.coffee" > ~/.ssh/config
|
||||
echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config
|
||||
echo " IdentitiesOnly yes" >> ~/.ssh/config
|
||||
chmod 600 ~/.ssh/config
|
||||
|
||||
- name: Deploy to pages-dev branch
|
||||
run: |
|
||||
# Configure Git
|
||||
|
@ -51,7 +64,7 @@ jobs:
|
|||
git commit -m "Deploy static site"
|
||||
|
||||
# Set the URL again
|
||||
git remote set-url origin "https://${{ secrets.FORGEJO_USER }}:${{ secrets.FORGEJO_TOKEN }}@git.private.coffee/PrivateCoffee/privatecoffee-website.git"
|
||||
git remote set-url origin "git@git.private.coffee:PrivateCoffee/privatecoffee-website.git"
|
||||
|
||||
# Force push to the 'pages-dev' branch
|
||||
git push origin pages-dev --force
|
||||
|
|
|
@ -24,6 +24,19 @@ jobs:
|
|||
- name: Generate static site
|
||||
run: python3 main.py --theme pride --domains pride.coffee,www.pride.coffee
|
||||
|
||||
- name: Set up SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan -t ed25519 git.private.coffee >> ~/.ssh/known_hosts
|
||||
|
||||
# Create SSH config file to ensure the correct identity file is used
|
||||
echo "Host git.private.coffee" > ~/.ssh/config
|
||||
echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config
|
||||
echo " IdentitiesOnly yes" >> ~/.ssh/config
|
||||
chmod 600 ~/.ssh/config
|
||||
|
||||
- name: Deploy to pages-pride branch
|
||||
run: |
|
||||
# Configure Git
|
||||
|
@ -49,7 +62,7 @@ jobs:
|
|||
git commit -m "Deploy static site"
|
||||
|
||||
# Set the URL again
|
||||
git remote set-url origin "https://${{ secrets.FORGEJO_USER }}:${{ secrets.FORGEJO_TOKEN }}@git.private.coffee/PrivateCoffee/privatecoffee-website.git"
|
||||
git remote set-url origin "git@git.private.coffee:PrivateCoffee/privatecoffee-website.git"
|
||||
|
||||
# Force push to the 'pages-pride' branch
|
||||
git push origin pages-pride --force
|
||||
|
|
|
@ -24,6 +24,19 @@ jobs:
|
|||
- name: Generate static site
|
||||
run: python3 main.py
|
||||
|
||||
- name: Set up SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan -t ed25519 git.private.coffee >> ~/.ssh/known_hosts
|
||||
|
||||
# Create SSH config file to ensure the correct identity file is used
|
||||
echo "Host git.private.coffee" > ~/.ssh/config
|
||||
echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config
|
||||
echo " IdentitiesOnly yes" >> ~/.ssh/config
|
||||
chmod 600 ~/.ssh/config
|
||||
|
||||
- name: Deploy to pages branch
|
||||
run: |
|
||||
# Configure Git
|
||||
|
@ -49,7 +62,7 @@ jobs:
|
|||
git commit -m "Deploy static site"
|
||||
|
||||
# Set the URL again
|
||||
git remote set-url origin "https://${{ secrets.FORGEJO_USER }}:${{ secrets.FORGEJO_TOKEN }}@git.private.coffee/PrivateCoffee/privatecoffee-website.git"
|
||||
git remote set-url origin "git@git.private.coffee:PrivateCoffee/privatecoffee-website.git"
|
||||
|
||||
# Force push to the 'pages' branch
|
||||
git push origin pages --force
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue