-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.36 KB
/
install-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: "test-install"
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup ssh
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Install
run: |
mkdir -p /tmp/ssh
chmod 700 /tmp/ssh
echo ${{ secrets.SSH_PRIVATE_KEY }} > /tmp/ssh/id_rsa
chmod 600 /tmp/ssh/id_rsa
# Update known hosts within the container (recommended)
echo -e "${GREEN}Update known hosts${NC}"
ssh-keyscan -H github.com >> /tmp/ssh/known_hosts
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-v /tmp/ssh:/root/.ssh \
-e SSH_AUTH_SOCK=/ssh-agent \
manjarolinux/base:latest \
/bin/bash -c "
GREEN='\033[0;32'; NC='\033[om'
echo -e '${GREEN}Install openssh and git${NC}'
pacman -Sy --noconfirm openssh git && \
echo -e '${GREEN}Add /workspace to trusted repos${NC}'
git config --global --add safe.directory /workspace && \
echo -e '${GREEN}Start install${NC}'
cd /workspace && \
./install.sh
"