-
Notifications
You must be signed in to change notification settings - Fork 3
34 lines (33 loc) · 1.07 KB
/
master.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
name: Push built docker image straight over the wire
on:
push:
schedule:
- cron: '00 00 * * 1'
jobs:
docker_catapult:
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
- name: Setup Environment
run: |
echo "REPO_NAME=${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/}" >> $GITHUB_ENV
echo "token = \"${{secrets.TOKEN}}\"" >> secret.py
- name: Build Docker Image
run: |
docker image build \
--label owner="$GITHUB_REPOSITORY_OWNER" \
-t "$REPO_NAME" .
- name: Save Docker Image
run: docker save "$REPO_NAME" -o "$REPO_NAME".tar
- name: scp ssh pipelines
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
with:
host: hsnipe.moe
user: root
key: ${{secrets.SSH_KEY}}
scp: |
"./$REPO_NAME.tar" => /home/
last_ssh: |
docker image load --input "/home/$REPO_NAME.tar"
docker stop -t 2 "$REPO_NAME" || true
docker run -d --name "$REPO_NAME" --rm "$REPO_NAME"