-
Notifications
You must be signed in to change notification settings - Fork 13
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 ebd2633
Showing
7 changed files
with
98 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,19 @@ | ||
name: Example/Test | ||
on: push | ||
|
||
jobs: | ||
test: | ||
name: Example/Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1.0.0 | ||
with: | ||
fetch-depth: 1 | ||
- name: Upload example static assets | ||
uses: gregbrimble/dark-static-assets-action@master | ||
with: | ||
user: gregbrimble | ||
password: ${{ secrets.DARK_PASSWORD }} | ||
canvas: gregbrimble-staticassetsactionexample | ||
paths: example |
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 @@ | ||
FROM alpine:3 | ||
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Greg Brimble | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,23 @@ | ||
# Dark Static Assets Action | ||
|
||
> Upload Static Assets to a [Dark](https://darklang.com/) canvas | ||
[![GitHub Actions Example/Test](https://github.com/GregBrimble/dark-static-assets-action/workflows/Example/Test/badge.svg)](https://github.com/GregBrimble/dark-static-assets-action/actions?query=workflow%3AExample%2FTest) | ||
|
||
## Usage | ||
|
||
As a part of your [GitHub Actions](https://github.com/features/actions) workflow, add a new step as follows: | ||
|
||
```yml | ||
- name: Upload static assets to Dark | ||
uses: gregbrimble/dark-static-assets-action@master | ||
with: | ||
user: DARK_USERNAME_HERE | ||
password: ${{ secrets.DARK_PASSWORD }} | ||
canvas: DARK_CANVAS_NAME_HERE | ||
paths: PATH_TO_DIRECTORY_HERE | ||
``` | ||
We strongly advise utilizing [GitHub Actions secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) to securely store your Dark password. | ||
A full example can be found in [.github/workflows/default.yml](https://github.com/GregBrimble/dark-static-assets-action/blob/master/.github/workflows/default.yml). |
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,22 @@ | ||
name: 'Upload static assets to Dark canvas' | ||
author: 'Greg Brimble' | ||
description: 'Upload static assets to a Dark canvas as a part of your GitHub Actions pipeline' | ||
inputs: | ||
user: | ||
description: 'Your Dark username' | ||
required: true | ||
password: | ||
description: 'Your Dark password' | ||
required: true | ||
canvas: | ||
description: 'Your Dark canvas name' | ||
required: true | ||
paths: | ||
description: 'The files to upload' | ||
required: true | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
branding: | ||
icon: 'upload-cloud' | ||
color: 'purple' |
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,9 @@ | ||
#!/bin/sh | ||
|
||
wget https://dark-cli.storage.googleapis.com/latest/dark-cli-linux | ||
chmod +x ./dark-cli-linux | ||
|
||
export DARK_CLI_USER="$INPUT_USER" | ||
export DARK_CLI_PASSWORD="$INPUT_PASSWORD" | ||
|
||
./dark-cli-linux "$INPUT_PATHS" --canvas "$INPUT_CANVAS" |
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 @@ | ||
<h1>Hello, world!</h1> |