-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 894 add docker configuration (#898)
- Loading branch information
1 parent
1d641a6
commit 053fa15
Showing
23 changed files
with
142,494 additions
and
168,227 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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# The ID of your GitHub App | ||
APP_ID= | ||
|
||
# Go to https://smee.io/new set this to the URL that you are redirected to. | ||
WEBHOOK_PROXY_URL= | ||
WEBHOOK_SECRET=development | ||
|
||
# Use `trace` to get verbose logging or `info` to show less | ||
LOG_LEVEL=debug | ||
|
||
# Go to https://smee.io/new set this to the URL that you are redirected to. | ||
WEBHOOK_PROXY_URL= |
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,29 +1,36 @@ | ||
name: App Stats | ||
|
||
on: | ||
schedule: | ||
- cron: '0 6 * * *' | ||
- cron: '0 6 0 * *' | ||
|
||
jobs: | ||
log: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: gr2m/[email protected] | ||
- name: 'Checkout sources' | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Collect stats' | ||
uses: gr2m/[email protected] | ||
id: stats | ||
with: | ||
id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.PRIVATE_KEY }} | ||
- run: "echo '{\"installations\": ${{ steps.stats.outputs.installations }}, \"repositories\": ${{ steps.stats.outputs.repositories }}, \"suspended\": ${{ steps.stats.outputs.suspended_installations }}, \"popular\": ${{ steps.stats.outputs.popular_repositories }} }' > public/stats.json" | ||
- name: Commit Action Installation Statistics | ||
|
||
- name: 'Commit Action Installation Statistics' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add public/stats.json | ||
git commit -m "Build by GitHub Actions" || true | ||
if: job.status == 'success' | ||
- name: Update repo | ||
|
||
- name: 'Update repo' | ||
run: git pull --no-rebase | ||
- name: Push changes | ||
|
||
- name: 'Push changes' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
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,29 +1,73 @@ | ||
name: 'main' | ||
concurrency: main_environment | ||
|
||
on: | ||
push: | ||
branches: main | ||
branches: | ||
- main | ||
pull_request: | ||
branches: main | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tests: | ||
cicd: | ||
runs-on: ubuntu-latest | ||
env: | ||
CI: true | ||
steps: | ||
- name: 'Checkout sources' | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Setup NodeJS' | ||
uses: actions/setup-node@v3 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: 'Install dependencies' | ||
run: yarn install | ||
|
||
- name: 'Build distribution' | ||
run: yarn action:dist | ||
|
||
- name: 'Run unit-tests' | ||
run: yarn test | ||
|
||
- name: 'Run code coverage' | ||
run: yarn run coverage | ||
|
||
- name: 'Upload code coverage report' | ||
run: bash <(curl -s https://codecov.io/bash) -t ${{secrets.CODECOV_SECRET_TOKEN }} | ||
|
||
- name: 'Build server dist' | ||
run: yarn server:dist | ||
|
||
- name: 'Build docker image' | ||
run: docker build -t cib . | ||
|
||
- name: 'Configure AWS credentials' | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_DEFAULT_REGION }} | ||
|
||
- name: 'Login to Amazon ECR' | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
with: | ||
mask-password: 'true' | ||
|
||
- name: 'Tag image for PR and push to ECR' | ||
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }} | ||
run: | | ||
docker tag cib ${{ secrets.AWS_ECR_ENDPOINT }}:pr-${GITHUB_SHA::8} | ||
docker push ${{ secrets.AWS_ECR_ENDPOINT }}:pr-${GITHUB_SHA::8} | ||
- name: 'Tag image for main and push to ECR' | ||
if: ${{ github.event_name == 'push' && github.actor != 'dependabot[bot]' }} | ||
run: | | ||
docker tag cib ${{ secrets.AWS_ECR_ENDPOINT }}:main-${GITHUB_SHA::8} | ||
docker tag cib ${{ secrets.AWS_ECR_ENDPOINT }}:main-latest | ||
docker push ${{ secrets.AWS_ECR_ENDPOINT }}:main-${GITHUB_SHA::8} | ||
docker push ${{ secrets.AWS_ECR_ENDPOINT }}:main-latest |
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,39 +1,49 @@ | ||
name: 'release' | ||
name: release | ||
|
||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
release: | ||
name: Semantic Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout sources' | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Setup NodeJS' | ||
uses: actions/setup-node@v3 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: 'Install dependencies' | ||
run: yarn install | ||
|
||
- name: 'Run unit-tests' | ||
run: yarn test | ||
- name: 'Build distribution' | ||
|
||
- name: 'Build GitHub Actions distribution' | ||
run: yarn action:dist | ||
|
||
- name: 'Semantic Release' | ||
id: semantic | ||
uses: cycjimmy/semantic-release-action@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: 'GitHub release' | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ steps.semantic.outputs.new_release_version }} | ||
- name: 'Commit GitHub Action distribution' | ||
|
||
- name: 'Commit GitHub Actions distribution' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add dist/index.js | ||
git add action-dist/index.js | ||
git commit -m "Build by GitHub Actions" || true | ||
if: job.status == 'success' | ||
|
||
- name: 'Push changes' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
|
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
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,6 @@ | ||
FROM node:20-alpine | ||
RUN mkdir /app | ||
COPY server-dist /app/server-dist | ||
WORKDIR /app | ||
RUN npm install pm2 -g | ||
CMD ["pm2-runtime", "./server-dist/index.js"] |
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
Oops, something went wrong.