-
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
0 parents
commit 6fcfd7b
Showing
6 changed files
with
110 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,2 @@ | ||
secret | ||
my |
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,15 @@ | ||
LABEL "com.github.actions.name"="WooCart Deploy" | ||
LABEL "com.github.actions.description"="Deploy changes from your GitHUb repository to your store." | ||
LABEL "com.github.actions.icon"="upload-cloud" | ||
LABEL "com.github.actions.color"="blue" | ||
LABEL "maintainer"="Niteo.co <[email protected]>" | ||
|
||
FROM alpine:3.11 | ||
|
||
RUN apk add --no-cache bash curl unzip ca-certificates fuse openssh-client jq \ | ||
&& wget -qO- https://rclone.org/install.sh | bash \ | ||
&& apk del bash curl unzip | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
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,3 @@ | ||
test: | ||
env INPUT_URL=http://localhost:8080 INPUT_USERNAME=admin INPUT_PASSWORD=secret INPUT_REMOTE=/plugins/woocommerce INPUT_LOCAL=my/plugins/woocommerce bash entrypoint.sh | ||
|
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,49 @@ | ||
# WooCart Deploy Action | ||
|
||
Sync your GitHub repository with your store on WooCart.com. | ||
|
||
## Inputs | ||
|
||
### `url` | ||
|
||
**Required** The URL of WebDAV server (starting with https://...) | ||
|
||
### `username` | ||
|
||
**Required** The name of the user. | ||
|
||
### `password` | ||
|
||
**Required** The password for the user. | ||
|
||
### `local` | ||
|
||
**Required** Path in GitHub repository to sync. | ||
|
||
### `remote` | ||
|
||
**Required** Path on remote to sync into. | ||
|
||
## Example usage | ||
|
||
1. Create a `.github/workflows/deploy.yml` file in your GitHub repo, if one doesn't exist already. | ||
2. Add the following code to the `deploy.yml` file. | ||
```yaml | ||
name: Deploy my-plugin | ||
on: push | ||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Deploy my-plugin to WooCart | ||
uses: woocart/deploy-action@v3 | ||
with: | ||
url: ${{ secrets.WEBDAV_URL }} | ||
username: ${{ secrets.WEBDAV_USERNAME }} | ||
password: ${{ secrets.WEBDAV_PASSWORD }} | ||
local: "dist/" | ||
remote: "plugins/my-plugin" | ||
``` | ||
3. Create `WEBDAV_URL`, `WEBDAV_USERNAME`, `WEBDAV_PASSWORD` secret using [GitHub Action's Secret](https://developer.github.com/actions/creating-workflows/storing-secrets). You can find these values in WooCart > Settings tab for your store. |
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,24 @@ | ||
name: 'WooCart Deploy' | ||
description: 'Deploy changes from your GitHUb repository to your store.' | ||
inputs: | ||
url: | ||
description: 'WEBDAV url' | ||
required: true | ||
username: | ||
description: 'WEBDAV user' | ||
required: true | ||
password: | ||
description: 'WEBDAV password' | ||
required: true | ||
local: | ||
description: 'Local directory' | ||
required: true | ||
remote: | ||
description: 'Remote directory' | ||
required: true | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
branding: | ||
color: 'purple' | ||
icon: 'upload-cloud' |
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,17 @@ | ||
#!/usr/bin/env bash | ||
# shellcheck disable=SC2001,SC2002,SC2034,SC1090,SC2154,SC1117 | ||
|
||
# Fail fast and fail hard. | ||
set -Eeuo pipefail | ||
|
||
mkdir -p ~/.config/rclone/ | ||
echo " | ||
[woocart] | ||
type = webdav | ||
pass = $(rclone obscure $INPUT_PASSWORD) | ||
url = $INPUT_URL | ||
user = $INPUT_USERNAME | ||
vendor = other | ||
" > ~/.config/rclone/rclone.conf | ||
|
||
rclone -v sync $INPUT_LOCAL woocart:$INPUT_REMOTE |