AliceClass/.gitea/workflows/deploy.yml

38 lines
1.5 KiB
YAML
Raw Normal View History

2024-07-04 17:18:46 -03:00
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
2024-07-08 20:05:49 -03:00
Deploy:
runs-on: ubuntu-latest
2024-07-04 17:18:46 -03:00
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
2024-07-08 20:05:49 -03:00
uses: RouxAntoine/checkout@v3.5.4
2024-07-04 17:18:46 -03:00
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
2024-07-08 20:05:49 -03:00
- name: Setup env
run: |
sudo apt update -y
sudo apt install bundler -y
- name: Setup bundle deps
run: cd ${{ gitea.workspace }}
2024-07-04 17:18:46 -03:00
- run: bundle install
2024-07-08 20:05:49 -03:00
- name: Build
run: bundle exec jekyll build
- run: echo "🍏 This job's status is ${{ job.status }}."
2024-07-08 20:06:40 -03:00
- name: Deploy to alice
2024-07-08 20:07:05 -03:00
run: |
2024-07-08 20:06:07 -03:00
echo "${{ secrets.SCP_KEY_ALICE }}" > /tmp/ssh_private_key
chmod 600 /tmp/ssh_private_key
2024-07-08 21:07:13 -03:00
mv _site aliceclass
2024-07-08 21:11:13 -03:00
scp -o "StrictHostKeyChecking no" -i /tmp/ssh_private_key -P ${{ secrets.SSH_PORT_ALICE }} -r aliceclass act_runner@alice.ufsj.edu.br:/var/www/html
2024-07-08 20:05:49 -03:00
2024-07-04 17:18:46 -03:00
- run: echo "🍏 This job's status is ${{ job.status }}."