Actions_tests/.forgejo/workflows/test.yaml

67 lines
2.1 KiB
YAML
Raw Normal View History

2024-04-16 07:19:19 +00:00
on: [push]
jobs:
2024-04-19 09:14:44 +00:00
compilation:
name: Compilation of content
runs-on: bookworm
container: minidocks/mkdocs
steps:
- name: Add NodeJs & Git
run: |
uname -a
apk add nodejs npm git
- name: Checkout repository with git
run: |
git clone --depth 1 https://git.numenaute.org/YannK/Actions_tests.git
# uses: actions/checkout@v4
# with:
# github-server-url: https://git.numenaute.org/
- name: Show content
run: |
pwd
ls -al
- name: Compile mkdocs
run: |
cd Actions_tests
mkdocs build
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: Mkdocs_files
path: /workspace/YannK/Actions_tests/Actions_tests/site
2024-04-19 07:49:50 +00:00
2024-04-19 08:43:42 +00:00
ssh_test:
2024-04-19 09:25:57 +00:00
name: SSH deployment
2024-04-19 07:47:38 +00:00
runs-on: bookworm
2024-04-19 09:25:57 +00:00
container: alpine
2024-04-19 07:49:50 +00:00
steps:
2024-04-19 09:30:01 +00:00
- name: Add NodeJs, rsync & ssh
2024-04-19 09:16:10 +00:00
run: |
uname -a
2024-04-19 09:30:01 +00:00
apk add nodejs npm openssh-client rsync
2024-04-19 08:45:15 +00:00
- name: Create directory
2024-04-19 07:47:38 +00:00
run: |
2024-04-19 08:41:08 +00:00
mkdir -p ~/.ssh/
2024-04-19 08:47:42 +00:00
- name: Create file
2024-04-19 08:45:15 +00:00
run: |
2024-04-19 08:46:06 +00:00
touch ~/.ssh/id_rsa
2024-04-19 09:27:13 +00:00
chmod 400 ~/.ssh/id_rsa
2024-04-19 08:47:42 +00:00
- name: Install SSH key to proper place
run: |
2024-04-19 08:49:02 +00:00
echo "Preparing copy"
2024-04-19 08:28:19 +00:00
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
2024-04-19 09:14:44 +00:00
- name: Adding known hosts
2024-04-19 08:50:29 +00:00
run: |
2024-04-19 09:00:19 +00:00
ssh-keyscan -p ${{ secrets.SSH_PORT }} -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
2024-04-19 08:28:19 +00:00
- name: Connect and check
run: |
2024-04-19 09:02:16 +00:00
ssh -i ~/.ssh/id_rsa -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "ls -al"
- name: Create a file
run: |
2024-04-19 09:14:44 +00:00
ssh -i ~/.ssh/id_rsa -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "touch CD_TEST.txt"
- name: Download Artifact
2024-04-19 09:28:54 +00:00
uses: actions/download-artifact@v3
2024-04-19 09:14:44 +00:00
with:
name: Mkdocs_files
- name: Send the Mkdocs_files
run: |
rsync -avPz -e 'ssh -p ${{ secrets.SSH_PORT }}' . ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:www