-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Dockerfile and its release pipeline (#598)
- Loading branch information
Showing
4 changed files
with
87 additions
and
1 deletion.
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,37 @@ | ||
name: Release Docker Image | ||
on: | ||
release: | ||
types: | ||
- published | ||
jobs: | ||
|
||
publish-docker: | ||
name: Generating Docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Get version without v character | ||
id: version | ||
run: | | ||
VERSION=${{github.event.release.tag_name}} | ||
VERSION_WITHOUT_V=${VERSION:1} | ||
echo "value=${VERSION_WITHOUT_V}" >> $GITHUB_OUTPUT | ||
- name: Release to Docker | ||
run: | | ||
echo ${{secrets.DOCKER_PASSWORD}} | docker login -u ${{secrets.DOCKER_USERNAME}} --password-stdin | ||
npm run docker:build | ||
docker tag asyncapi/cli:latest asyncapi/cli:${{ steps.version.outputs.value }} | ||
docker push asyncapi/cli:${{ steps.version.outputs.value }} | ||
docker push asyncapi/cli:latest | ||
- name : Sync README.md and Description to Docker Hub | ||
uses: actions/checkout@master | ||
|
||
- uses: meeDamian/[email protected] | ||
with: | ||
user: ${{secrets.DOCKER_USERNAME}} | ||
pass: ${{ secrets.DOCKER_PASSWORD }} | ||
slug: asyncapi/cli | ||
description: true |
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,24 @@ | ||
FROM node:16-alpine | ||
|
||
# Create a non-root user | ||
RUN addgroup -S myuser && adduser -S myuser -G myuser | ||
|
||
WORKDIR /app | ||
|
||
# Since 0.14.0 release of html-template chromium is needed for pdf generation | ||
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser | ||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true | ||
# Since 0.30.0 release Git is supported and required as a dependency | ||
# Since 0.14.0 release of html-template chromium is needed for pdf generation. | ||
# More custom packages for specific template should not be added to this dockerfile. Instead, we should come up with some extensibility solution. | ||
RUN apk --update add git chromium && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
rm /var/cache/apk/* | ||
|
||
# Installing latest released npm package | ||
RUN npm install --ignore-scripts -g @asyncapi/cli | ||
|
||
# Switch to the non-root user | ||
USER myuser | ||
|
||
ENTRYPOINT [ "asyncapi" ] |
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
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