13
13
# Allows you to run this workflow manually from the Actions tab
14
14
workflow_dispatch :
15
15
16
+ permissions :
17
+ contents : read
18
+ pages : write
19
+ id-token : write
20
+
16
21
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17
22
jobs :
18
23
# This workflow contains a single job called "build"
19
- start :
24
+ build :
20
25
# The type of runner that the job will run on
21
26
runs-on : ubuntu-latest
22
27
77
82
force_orphan : true
78
83
publish_dir : ./public
79
84
cname : liudon.com
80
- ipfs :
81
- name : Build and Publish IPFS
82
- uses : ./.github/workflows/ipfs.yml
83
- secrets :
84
- SSHHOST : ${{ secrets.SSHHOST }}
85
- SSHKEY : ${{ secrets.SSHKEY }}
86
- FILEBASE_BUCKET : ${{ secrets.FILEBASE_BUCKET }}
87
- FILEBASE_KEY : ${{ secrets.FILEBASE_KEY }}
88
- FILEBASE_SECRET : ${{ secrets.FILEBASE_SECRET }}
89
- needs :
90
- - start
91
-
92
- end :
93
- runs-on : ubuntu-latest
94
- steps :
85
+
95
86
- name : Easyindex
96
87
run : |
97
88
echo '${{ secrets.GOOGLE_INDEXING_API_TOKEN }}' > ./credentials.json
@@ -104,5 +95,39 @@ jobs:
104
95
curl -s -L https://github.com/usk81/easyindex-cli/releases/download/v1.0.6/easyindex-cli_1.0.6_linux_amd64.tar.gz | tar xz
105
96
chmod +x ./easyindex-cli
106
97
./easyindex-cli google -d -c ./url.csv
107
- needs :
108
- - start
98
+
99
+ - name : Generate robots.txt
100
+ run : |
101
+ echo "User-agent: *" > ./public/robots.txt
102
+ echo "Disallow: /" >> ./public/robots.txt
103
+
104
+ - name : Connect to ssh in BG
105
+ timeout-minutes : 2
106
+ run : |
107
+ echo "${{ secrets.SSHKEY }}" > ../privkey
108
+ chmod 600 ../privkey
109
+ ssh -o StrictHostKeyChecking=no ${{ secrets.SSHHOST }} -i ../privkey -L 5001:localhost:5001 -fTN
110
+
111
+ - name : IPFS upload
112
+ uses : filebase/ipfs-action@master
113
+ id : deploy
114
+ timeout-minutes : 2
115
+ with :
116
+ path : ./public
117
+ service : ipfs
118
+ verbose : true
119
+ host : localhost
120
+ port : 5001
121
+ protocol : http
122
+ key : ipfs-action
123
+
124
+ - name : IPFS upload to filebase
125
+ uses : filebase/ipfs-action@master
126
+ with :
127
+ path : ./public
128
+ service : filebase
129
+ pinName : ipfs-action
130
+ filebaseBucket : ${{ secrets.FILEBASE_BUCKET }}
131
+ filebaseKey : ${{ secrets.FILEBASE_KEY }}
132
+ filebaseSecret : ${{ secrets.FILEBASE_SECRET }}
133
+ key : ipfs-action
0 commit comments