Skip to content

Commit

Permalink
Add Cloudflare DNS support
Browse files Browse the repository at this point in the history
  • Loading branch information
cap10morgan committed Jan 16, 2020
1 parent f85c0b0 commit f439995
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
12 changes: 12 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ inputs:
pinata-secret-api-key:
description: 'Secret API key for Piñata pinning service'
required: false
cloudflare-api-email:
description: 'Cloudflare API email for DNS updates'
required: false
cloudflare-api-key:
description: 'Cloudflare API key for DNS updates'
required: false
cloudflare-zone:
description: 'Cloudflare DNS zone to update on deployment'
required: false
cloudflare-record:
description: 'Cloudflare DNS record to update on deployment'
required: false
outputs:
ipfs-hash:
description: 'Hash of pinned IPFS deployment'
Expand Down
13 changes: 12 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,27 @@ async function main() {
const pinningService = core.getInput("pinning-service");
const pinataAPIKey = core.getInput("pinata-api-key");
const pinataSecretAPIKey = core.getInput("pinata-secret-api-key");
const cloudflareAPIEmail = core.getInput("cloudflare-api-email");
const cloudflareAPIKey = core.getInput("cloudflare-api-key");
const cloudflareZone = core.getInput("cloudflare-zone");
const cloudflareRecord = core.getInput("cloudflare-record");

core.info(`Deploying to ${pinningService}`);
core.info(`Deploying to ${pinningService} & updating Cloudflare DNS`);

const ipfsHash = await deploy({
publicDirPath: deployDir,
remotePinners: [pinningService],
dnsProviders: ['cloudflare'],
credentials: {
pinata: {
apiKey: pinataAPIKey,
secretApiKey: pinataSecretAPIKey
},
cloudflare: {
apiEmail: cloudflareAPIEmail,
apiKey: cloudflareAPIKey,
zone: cloudflareZone,
record: cloudflareRecord
}
},
open: false,
Expand Down

0 comments on commit f439995

Please sign in to comment.