summaryrefslogtreecommitdiffstats
path: root/.github/workflows/doconfly.yml
blob: a720a663614431b88c09da1265cabb5cee76b11f (plain)
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
name: doconfly
on:
  push:
    branches:
      - master
    tags:
      - "*"

jobs:
  doconfly:
    name: doconfly job
    runs-on: ubuntu-latest
    env:
      PORT: ${{ secrets.PORT }}
      SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
      TAKOYAKI: ${{ secrets.TAKOYAKI }}
      USER: ${{ secrets.USER }}
      DOCUMENTATION_PATH: ${{ secrets.DOCUMENTATION_PATH }}
      DOCUMENTATION_URL: ${{ secrets.DOCUMENTATION_URL }}
    steps:
      - run: |
          which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
          eval $(ssh-agent -s)
          echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
          mkdir -p ~/.ssh
          chmod 700 ~/.ssh
          ssh-keyscan -p $PORT $TAKOYAKI >> ~/.ssh/known_hosts
          chmod 644 ~/.ssh/known_hosts
          ssh $USER@$TAKOYAKI -p $PORT "doconfly/doconfly.sh $GITHUB_REPOSITORY $GITHUB_REF $DOCUMENTATION_PATH $DOCUMENTATION_URL"