-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and push images w/ GH action (#1)
* Fix README
- Loading branch information
Showing
5 changed files
with
71 additions
and
24 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,5 @@ | ||
/_build/ | ||
/.git/ | ||
/.github/ | ||
/.vscode/ | ||
/.idea/ |
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,51 @@ | ||
name: Build Docker image | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: ["*"] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@13d241b293754004c80624b5567555c4a39ffbe3 | ||
with: | ||
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.ECR_SECRET_KEYS }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@aaf69d68aa3fb14c1d5a6be9ac61fe15b48453a2 | ||
|
||
- name: Construct tags / labels for an image | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: | | ||
${{ steps.login-ecr.outputs.registry }}/${{ github.repository }} | ||
${{ env.REGISTRY }}/${{ github.repository }} | ||
tags: | | ||
type=sha | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
push: ${{ github.event_name == 'push' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 |
---|---|---|
|
@@ -7,5 +7,3 @@ erl_crash.dump | |
.tags* | ||
*.sublime-workspace | ||
.DS_Store | ||
Dockerfile | ||
docker-compose.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,15 @@ | ||
FROM ghcr.io/rbkmoney/build-erlang:785d48cbfa7e7f355300c08ba9edc6f0e78810cb AS builder | ||
RUN mkdir /build | ||
COPY . /build/ | ||
WORKDIR /build | ||
RUN rebar3 compile | ||
RUN rebar3 as prod release | ||
|
||
# Keep in sync with Erlang/OTP version in build image | ||
FROM erlang:24.1.3.0-slim | ||
ENV SERVICE=dominant | ||
COPY --from=builder /build/_build/prod/rel/${SERVICE} /opt/${SERVICE} | ||
WORKDIR /opt/${SERVICE} | ||
ENTRYPOINT [] | ||
CMD /opt/${SERVICE}/bin/${SERVICE} foreground | ||
EXPOSE 8022 |
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 |
---|---|---|
@@ -1,25 +1,3 @@ | ||
# Dominant | ||
|
||
Сервис отдачи и изменения доменной конфигурации системы (она же статика). | ||
|
||
## Сборка | ||
|
||
Для запуска процесса сборки достаточно выполнить просто: | ||
|
||
make | ||
|
||
Чтобы запустить полученную сборку в режиме разработки и получить стандартный [Erlang shell][2], нужно всего лишь: | ||
|
||
make start | ||
|
||
> _Хозяйке на заметку._ При этом используется стандартный Erlang релиз, собранный при помощи [relx][3] в режиме разработчика. | ||
> _Хозяйке на заметку._ В зависимости от вашего окружения и операционной системы вам может понадобиться [Docker Machine][4]. | ||
## Документация | ||
|
||
Дальнейшую документацию можно почерпнуть, пройдясь по ссылкам в [соответствующем документе](doc/index.md). | ||
|
||
[2]: http://erlang.org/doc/man/shell.html | ||
[3]: https://github.com/erlware/relx | ||
[4]: https://docs.docker.com/machine/install-machine/ |