Skip to content

Commit 6f109b1

Browse files
committed
Add a README
1 parent 8e9bafa commit 6f109b1

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Agnostic Serverless Functions in Java: Package Action
2+
3+
An [agnostic serverless function](https://github.com/axel-op/agnostic-serverless-functions-java) is a serverless function whose configuration is not linked to a particular FaaS framework.
4+
5+
This action performs the packaging steps needed before deploying a Java function to a specific FaaS provider.
6+
7+
## Usage
8+
9+
```yml
10+
name: Example workflow
11+
12+
on: push
13+
14+
jobs:
15+
example-job:
16+
17+
env:
18+
FAAS_PROVIDER: gcloud
19+
MAVEN_SERVER_ID: github-packages # this is the id set in pom.xml
20+
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up JDK and Maven settings
25+
uses: actions/setup-java@v1
26+
with:
27+
java-version: 11
28+
server-id: ${{ env.MAVEN_SERVER_ID }}
29+
server-username: MAVEN_USERNAME
30+
server-password: MAVEN_PASSWORD
31+
- name: Package
32+
env:
33+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
34+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
35+
uses: axel-op/agnostic-serverless-functions-java-package-action@main
36+
with:
37+
function-name: name-of-your-function
38+
faas-provider: ${{ env.FAAS_PROVIDER }}
39+
# working-directory: . # required if different from $GITHUB_WORKSPACE
40+
41+
```
42+
43+
### Inputs
44+
45+
- `function-name`: the name of the function that will be deployed
46+
- `faas-provider`: the provider the function will be packaged for. Accepted values are: `azure`, `gcloud` (more providers to come).
47+
48+
### About Maven settings
49+
50+
Building an agnostic function [requires Maven artifacts](https://github.com/axel-op/agnostic-serverless-functions-java#configuration) hosted on GitHub Packages. [This README](https://github.com/axel-op/maven-packages) explains how to add them in the dependencies of your Maven project. To retrieve them during the workflow, [the Maven settings file](https://maven.apache.org/settings.html) must contain your credentials to GitHub Packages.
51+
52+
The example above uses [`actions/setup-java`](https://github.com/actions/setup-java) to tell Maven to use the environment variables `MAVEN_USERNAME` and `MAVEN_PASSWORD` as credentials. These environment variables are only set during the packaging step.
53+
54+
## Full example
55+
56+
Check out [this workflow](https://github.com/axel-op/agnostic-serverless-functions-java-example/blob/main/.github/workflows/deployment.yml) for a complete example of a deployment workflow using this action.

0 commit comments

Comments
 (0)