AliceClass/.gitea/workflows/build_and_deploy.yml

44 lines
1.6 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 🚀
2024-08-05 17:02:36 -03:00
on: [workflow_dispatch]
2024-07-04 17:18:46 -03:00
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
2024-07-10 14:57:24 -03:00
sudo apt install bundler -y
2024-07-10 17:40:20 -03:00
#
2024-07-10 14:57:24 -03:00
# baixar imagemagick
- run: cd ${{ gitea.workspace }}
2024-07-10 17:29:35 -03:00
#- name: Video script
# run: ./script/script.sh
2024-07-08 20:05:49 -03:00
- name: Setup bundle deps
2024-07-10 14:57:24 -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 }}."