Skip to content

Commit 70c770d

Browse files
committed
docs: update documentation with more examples
1 parent 0a76681 commit 70c770d

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# About
22

3-
A GitHub action to build maven projects while pulling dependencies from AWS CodeArtifact
3+
A GitHub action used as pre-requisite step in **build** workflows (`mvn package`)
4+
to configure maven to pull dependencies from AWS CodeArtifact.
5+
Also used as pre-requisite step in **release** workflows (`mvn deploy`) to push artifacts to AWS CodeArtifact
46

57
What it does:
68
1. Setup Java + Maven
@@ -10,7 +12,7 @@ What it does:
1012

1113
## Usage
1214

13-
Below is an example of how to use this action in the **build** workflow.
15+
Below is an example of how to use this action in the **build** workflow (when you need to pull artifacts from AWS CodeArtifact):
1416
For release/publish workflows use [agilecustoms/release](https://github.com/agilecustoms/release)
1517

1618
```yaml
@@ -24,7 +26,7 @@ jobs:
2426
- name: Checkout
2527
uses: actions/checkout@v5
2628

27-
- name: Setup Java
29+
- name: Setup Maven
2830
uses: agilecustoms/setup-maven-codeartifact@v1
2931
with:
3032
aws-account: ${{ vars.AWS_ACCOUNT_DIST }}
@@ -38,10 +40,9 @@ jobs:
3840
run: mvn verify --no-transfer-progress
3941
```
4042
41-
This action is designed for use in a **build** workflow when you need to access packages from CodeArtifact.
42-
In **release** workflow you need to bump a version in `pom.xml` file and add some git tags,
43-
so please check the [agilecustoms/release](https://github.com/agilecustoms/release) action —
44-
it represents a holistic release action (uses `setup-maven-codeartifact` under the hood)
43+
**release** workflow is more complex, it requires version bump in `pom.xml` and setting git tags.
44+
For release/publish artifacts in AWS CodeArtifact please use [agilecustoms/release](https://github.com/agilecustoms/release) action
45+
and specifically [AWS CodeArtifact Maven](https://github.com/agilecustoms/release/blob/main/docs/artifact-types/aws-codeartifact-maven.md) section
4546

4647
For build and release workflows it is recommended to use different IAM roles: `/ci/builder` and `/ci/publisher`.
4748
Builder has read-only access to CodeArtifact, while publisher has write access.
@@ -50,10 +51,8 @@ Below there are two terraform modules that have all necessary permissions to wor
5051
- **ci-publisher** - [github](https://github.com/agilecustoms/terraform-aws-ci-publisher) - [terraform registry module](https://registry.terraform.io/modules/agilecustoms/ci-publisher/aws/latest)
5152

5253
And this is [example](https://github.com/agilecustoms/terraform-aws-ci-publisher?tab=readme-ov-file#how-to-create-a-role-with-this-policy)
53-
how to create an AWS IAM role based on these policies with a password-less trust policy,
54-
so you do not need to store `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` in your repository secrets
55-
56-
Read more about software distribution in AWS in my [LinkedIn article](https://www.linkedin.com/pulse/software-distribution-aws-alexey-chekulaev-ubl0e)
54+
how to create an AWS IAM role based on these policies with a password-less trust policy,
55+
so you do not need to store `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` in your repository secrets
5756

5857
## Inputs
5958

@@ -80,11 +79,11 @@ All `java-*` inputs are pass through parameters to `actions/setup-java` action,
8079
| settings-repositories | Maven Central | Additional Maven repositories in XML format to be placed before CodeArtifact |
8180

8281
Notes:
83-
1. for `aws-account` it is recommended to have a dedicated AWS account (not dev, not prod) to store artifacts (S3 binaries, CodeArtifact, Docker images)
84-
2. default settings for `settings-pluginRepositories` and `settings-repositories` are good for projects
85-
that take 95% of dependencies from Maven Central and left 5% from corporate CodeArtifact.
86-
Come companies opt in to store all dependencies in CodeArtifact with Maven Central as an _upstream_.
87-
In this configuration you would want to set `settings-pluginRepositories` and `settings-repositories` to empty string `""`
82+
1. For `aws-account` it is recommended to have a dedicated AWS account (not dev, not prod) to store artifacts (S3 binaries, CodeArtifact, Docker images)
83+
2. Default settings for `settings-pluginRepositories` and `settings-repositories` are good for projects
84+
that take 95% of dependencies from Maven Central and left 5% from corporate CodeArtifact.
85+
Some companies opt in to store all dependencies in CodeArtifact with Maven Central as an _upstream_.
86+
In this configuration you would want to set `settings-pluginRepositories` and `settings-repositories` to empty string `""`
8887

8988
## Local development
9089

@@ -150,6 +149,11 @@ jobs:
150149

151150
This project is released under the [MIT License](./LICENSE)
152151

152+
## Articles
153+
154+
- [Software distribution in AWS](https://www.linkedin.com/pulse/software-distribution-aws-alexey-chekulaev-ubl0e)
155+
- [GitFlow vs Build-and-deploy](https://www.linkedin.com/pulse/gitflow-build-and-deploy-alex-chekulaev-lvive)
156+
153157
## Acknowledgements
154158

155159
- https://github.com/s4u/maven-settings-action — first action I tried, but it doesn't support pluginRepositories

0 commit comments

Comments
 (0)