forked from privacyguides/privacyguides.org
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9626aab
commit 65a4b6e
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Build IPFS Website | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
statuses: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: dweb | ||
url: https://cloudflare-ipfs.com/ipns/ipfs.privacyguides.org/en/index.html | ||
|
||
steps: | ||
- name: Cache Site | ||
id: cache-site | ||
uses: actions/cache@v4 | ||
with: | ||
path: site | ||
key: ipfs-test-site | ||
|
||
- name: Checkout repository | ||
if: steps.cache-site.outputs.cache-hit != 'true' | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: "false" | ||
|
||
- name: Python setup | ||
if: steps.cache-site.outputs.cache-hit != 'true' | ||
uses: actions/setup-python@v5 | ||
|
||
- name: Install Python dependencies | ||
if: steps.cache-site.outputs.cache-hit != 'true' | ||
run: | | ||
pip install mkdocs-material | ||
sudo apt install pngquant | ||
- name: Build website | ||
if: steps.cache-site.outputs.cache-hit != 'true' | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CARDS: false | ||
run: | | ||
mkdocs build --config-file config/mkdocs-offline.yml | ||
mkdocs --version | ||
- name: Save Site | ||
if: steps.cache-site.outputs.cache-hit != 'true' | ||
id: cache-site-save | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: site | ||
key: ipfs-test-site | ||
|
||
- id: deploy | ||
run: | | ||
wget https://dist.ipfs.tech/ipfs-cluster-ctl/v1.0.8/ipfs-cluster-ctl_v1.0.8_linux-amd64.tar.gz | ||
tar xvf ipfs-cluster-ctl_v1.0.8_linux-amd64.tar.gz | ||
./ipfs-cluster-ctl/ipfs-cluster-ctl --version | ||
root_cid=$(./ipfs-cluster-ctl/ipfs-cluster-ctl \ | ||
--host '/dns/cluster.ipfs.jonaharagon.net/tcp/443/tls/sni/cluster.ipfs.jonaharagon.net' \ | ||
--basic-auth ${{ secrets.CLUSTER_USERNAME }}:${{ secrets.CLUSTER_PASSWORD }} \ | ||
add \ | ||
--quieter \ | ||
--local \ | ||
--wait \ | ||
--cid-version 1 \ | ||
--name "https://github.com/$GITHUB_REPOSITORY/commits/$GITHUB_SHA" \ | ||
--expire-in 2190h \ | ||
--recursive site ) | ||
echo "cid=$root_cid" >> $GITHUB_OUTPUT | ||
# - id: cluster_deploy | ||
# uses: ipfs-shipyard/[email protected] | ||
# with: | ||
# path_to_add: site | ||
# cluster_host: /dns/cluster.ipfs.jonaharagon.net/tcp/443 | ||
# cluster_user: ${{ secrets.CLUSTER_USERNAME }} | ||
# cluster_password: ${{ secrets.CLUSTER_PASSWORD }} | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: textileio/cloudflare-update-dnslink@30414a408191218c8259e932ebdf4cbb7c652fe8 | ||
with: | ||
cid: ${{ steps.deploy.outputs.cid }} | ||
env: | ||
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} | ||
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE }} | ||
RECORD_DOMAIN: privacyguides.org | ||
RECORD_NAME: _dnslink.ipfs |