diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..84b98e0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu:18.04 + +LABEL version="1.0.0" +LABEL repository="https://github.com/convox/action-build" +LABEL homepage="https://convox.com/convox" +LABEL maintainer="Convox " + +LABEL "com.github.actions.name"="Convox Build" +LABEL "com.github.actions.description"="Build an app to deploy on Convox" +LABEL "com.github.actions.icon"="cloud" +LABEL "com.github.actions.color"="blue" + +RUN apt-get -qq update && apt-get -qq -y install curl + +RUN curl -L https://convox.com/cli/linux/convox -o /tmp/convox \ + && mv /tmp/convox /usr/local/bin/convox \ + && chmod 755 /usr/local/bin/convox + +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..974fa49 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# Convox Build Action +This Action [builds](https://docs.convox.com/deployment/builds) an app based on a [convox.yml](https://docs.convox.com/application/convox-yml) so that app can be deployed on Convox + +## Inputs +### `rack` +**Required** The name of the [Convox Rack](https://docs.convox.com/introduction/rack) you wish to build against. +### `app` +**Required** The name of the [app](https://docs.convox.com/deployment/creating-an-application) you wish to build. +## Outputs +### `release` +The ID of the release that is created when the build completes. +## Example usage +``` +uses: convox/action-build@v1 +with: + rack: staging + app: myapp +``` \ No newline at end of file diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..f37eb1d --- /dev/null +++ b/action.yml @@ -0,0 +1,16 @@ +name: Convox Build +description: Build a Convox app +author: Convox +inputs: + rack: + description: Convox Rack name + required: true + app: + description: Convox app name + required: true +outputs: + release: + description: Release ID of the created build +runs: + using: docker + image: Dockerfile \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..2502381 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh +echo "Building" +export CONVOX_RACK=$INPUT_RACK +release=$(convox build --app $INPUT_APP --id) +echo ::set-output name=release::$release +echo ::set-env name=RELEASE::$release