Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleA committed Mar 24, 2021
0 parents commit 2bf75c8
Show file tree
Hide file tree
Showing 15 changed files with 10,903 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: [push]

jobs:
test-deploy:
runs-on: ubuntu-latest
name: A job to deploy canisters to the IC
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: npm install
- name: Deploy canisters
id: deploy
uses: ./
with:
identity: ${{ secrets.DFX_IDENTITY }}
wallets: ${{ secrets.DFX_WALLETS }}
- name: Show success message
run: echo success!
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Various IDEs and Editors
.vscode/
.idea/
**/*~

# Mac OSX temporary files
.DS_Store
**/.DS_Store

# dfx temporary files
.dfx/

# frontend code
node_modules/
dist/
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:14.16.0-alpine

ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH="/home/node/.npm-global/bin:$PATH"

USER node

COPY dfx-install.sh /home/dfx-install.sh
COPY entrypoint.sh /home/node/entrypoint.sh

USER root

RUN apk add --update curl

RUN ["chmod", "+x", "/home/dfx-install.sh"]

RUN ["sh", "-m", "/home/dfx-install.sh"]

RUN ["chmod", "+x", "/home/node/entrypoint.sh"]

ENTRYPOINT ["/home/node/entrypoint.sh"]
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
![](https://storageapi.fleek.co/fleek-team-bucket/Blog%20Inline/ic-action.png)

# Deploy Action
[![Fleek](https://img.shields.io/badge/Made%20by-Fleek-blue)](https://fleek.co/)
[![Dev Slack](https://img.shields.io/badge/Dev%20Slack-Channel-blue)](https://slack.fleek.co/)
[![License](https://img.shields.io/badge/License-MIT-green)](https://github.com/FleekHQ/space-sdk/blob/master/LICENSE)


## Introduction

Fleek's Deploy Action provides an easy way to deploy your configured Fleek site's publish directory.

## Example Usage

Create a `.github/workflows/deploy.yml` workflow file in your repository with the following configuration:

```yml
on: [push]

jobs:
test-deploy:
runs-on: ubuntu-latest
name: A job to test the action-deploy action by deploying a test site
steps:
- uses: actions/checkout@v2
- name: Deploy test site
id: deploy
uses: fleekhq/action-deploy@v1
with:
apiKey: ${{ secrets.FLEEK_API_KEY }}
- name: Get the output url
run: echo "Deploy url is ${{ steps.deploy.outputs.deployUrl }}"
```
## Configuration Options
The action can be configured with the following input arguments:
- apiKey (required) - Your Fleek scoped API key that has permission to deploy to the configured site.
- workDir (optional) - The location of your .fleek.json config file. Defaults to repositories base directory.
- commitHash - (optional) - Optional git commit hash to deploy. Only useful for fleek sites linked to github.
## Contributing
To submit a feature, bug fix, or enhancement to Deploy Actions, follow these steps:
1. Fork this repository.
2. Make desired changes.
3. Confirm a successful Docker build with `docker build -t fleekhq/action-deploy .`.
4. [Open a Pull Request and follow the prompts](https://github.com/fleekhq/action-deploy/compare).

We value and appreciate all contributions.

## Related Resources

- [Fleek CLI](https://github.com/fleekhq/fleek-cli)
- [Fleek](https://fleek.co)

## License

Fleeks Deploy Action is licensed under a [GNU General Public License](LICENSE)
16 changes: 16 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Fleek IC Action'
description: 'Deploys canisters to the IC'
author: 'Fleek Labs'
branding:
icon: circle
color: gray-dark
inputs:
identity:
description: 'IC identity for deploying the canisters'
required: true
wallets:
description: 'IC wallets for deploying the canisters'
required: true
runs:
using: 'docker'
image: 'Dockerfile'
8 changes: 8 additions & 0 deletions canister_ids.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"hello": {
"ic": "etxr6-uqaaa-aaaab-qamkq-cai"
},
"hello_assets": {
"ic": "e2u2c-cyaaa-aaaab-qamla-cai"
}
}
2 changes: 2 additions & 0 deletions dfx-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh -l
echo y | sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
34 changes: 34 additions & 0 deletions dfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"canisters": {
"hello": {
"main": "src/hello/main.mo",
"type": "motoko"
},
"hello_assets": {
"dependencies": [
"hello"
],
"frontend": {
"entrypoint": "src/hello_assets/public/index.js"
},
"source": [
"src/hello_assets/assets",
"dist/hello_assets/"
],
"type": "assets"
}
},
"defaults": {
"build": {
"packtool": ""
}
},
"dfx": "0.6.26",
"networks": {
"local": {
"bind": "127.0.0.1:8000",
"type": "ephemeral"
}
},
"version": 1
}
17 changes: 17 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh -l

echo Creating deployer directory

mkdir ~/.config
mkdir ~/.config/dfx
mkdir ~/.config/dfx/identity
mkdir ~/.config/dfx/identity/default

echo Adding identity.pem and wallets file file

echo $INPUT_IDENTITY > ~/.config/dfx/identity/default/identity.pem
sed -i 's/\\r\\n/\r\n/g' ~/.config/dfx/identity/default/identity.pem
echo $INPUT_WALLETS > ~/.config/dfx/identity/default/wallets.json

echo "Deploying to the IC"
dfx deploy --network=ic
Loading

0 comments on commit 2bf75c8

Please sign in to comment.