Skip to content

Commit c896739

Browse files
authored
Update main.yml
1 parent e150c1f commit c896739

File tree

1 file changed

+43
-18
lines changed

1 file changed

+43
-18
lines changed

.github/workflows/main.yml

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ on:
1313
# Allows you to run this workflow manually from the Actions tab
1414
workflow_dispatch:
1515

16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
1621
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1722
jobs:
1823
# This workflow contains a single job called "build"
19-
start:
24+
build:
2025
# The type of runner that the job will run on
2126
runs-on: ubuntu-latest
2227

@@ -77,21 +82,7 @@ jobs:
7782
force_orphan: true
7883
publish_dir: ./public
7984
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+
9586
- name: Easyindex
9687
run: |
9788
echo '${{ secrets.GOOGLE_INDEXING_API_TOKEN }}' > ./credentials.json
@@ -104,5 +95,39 @@ jobs:
10495
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
10596
chmod +x ./easyindex-cli
10697
./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

Comments
 (0)