Skip to content

Commit

Permalink
Merge pull request #487 from codeforjapan/develop
Browse files Browse the repository at this point in the history
add geo cording osm
  • Loading branch information
ayuki-joto authored Dec 17, 2022
2 parents cbc33a3 + 5031e9e commit 799e07d
Show file tree
Hide file tree
Showing 30 changed files with 603 additions and 158 deletions.
110 changes: 80 additions & 30 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to Elastic Beanstalk
name: Deploy to ecs

on:
push:
Expand All @@ -8,10 +8,17 @@ on:
tags:
- 'v*'

env:
AWS_ROLE_ARN: arn:aws:iam::887442827229:role/GithubActions_decidim-cfj-cdk-deploy

jobs:
create-app-env:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
actions: write
contents: read
id-token: write
outputs:
image-tag: ${{ steps.output-app-env.outputs.image-tag }}
eb-environment-name: ${{ steps.output-app-env.outputs.eb-environment-name }}
Expand All @@ -30,48 +37,71 @@ jobs:
id: set-env-production
if: endsWith(github.ref, 'heads/master') || contains(github.ref, 'tags/v')
run: |
echo "IMAGE_TAG_PREFIX=production-v0-25-2" >> $GITHUB_ENV
echo "EB_ENVIRONMENT_NAME=production-v0-25-2" >> $GITHUB_ENV
echo "IMAGE_TAG_PREFIX=prd-v0252" >> $GITHUB_ENV
echo "EB_ENVIRONMENT_NAME=prd-v0252" >> $GITHUB_ENV
- name: Output App Env
id: output-app-env
run: |
echo "::set-output name=image-tag::${IMAGE_TAG_PREFIX}-${GITHUB_SHA::8}"
echo "::set-output name=eb-environment-name::${EB_ENVIRONMENT_NAME}"
echo "image-tag=${IMAGE_TAG_PREFIX}-${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
echo "eb-environment-name=${EB_ENVIRONMENT_NAME}" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
timeout-minutes: 1200
needs: create-app-env
permissions:
actions: write
contents: read
id-token: write

steps:
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
aws-region: ap-northeast-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push image to Amazon ECR
uses: docker/build-push-action@v2
if: endsWith(github.ref, 'heads/master') || endsWith(github.ref, 'heads/develop')
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPO_NAME }}
IMAGE_TAG: ${{ needs.create-app-env.outputs.image-tag }}
id: build-image
with:
push: true
tags: ${{ steps.login-ecr.outputs.registry }}/${{ secrets.AWS_ECR_REPO_NAME }}:${{ needs.create-app-env.outputs.image-tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move cache
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
deploy:
runs-on: ubuntu-latest
timeout-minutes: 1800
if: endsWith(github.ref, 'heads/develop') || contains(github.ref, 'tags/v')
permissions:
actions: write
contents: read
id-token: write
needs:
- create-app-env
- build
Expand All @@ -80,10 +110,9 @@ jobs:
- uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
aws-region: ap-northeast-1

- name: Login to Amazon ECR
Expand All @@ -104,22 +133,43 @@ jobs:
exit 1
fi
- uses: actions/setup-python@master
- name: Checkout decidim-cfj cdk
uses: actions/checkout@v3
with:
python-version: "3.7"
repository: codeforjapan/decidim-cfj-cdk
path: decidim-cfj-cdk

- name: Install awsebcli
run: pip install -U awsebcli
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16'

- name: Deploy to Elastic Beanstalk
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
working-directory: decidim-cfj-cdk

- name: Install dependencies
run: npm install -g aws-cdk
working-directory: decidim-cfj-cdk

- name: cdk deploy
run: cdk -c stage=$EB_ENVIRONMENT_NAME -c tag=$IMAGE_TAG deploy --all --require-approval never
working-directory: decidim-cfj-cdk
env:
AWS_DEFAULT_REGION: 'ap-northeast-1'
EB_ENVIRONMENT_NAME: ${{ needs.create-app-env.outputs.eb-environment-name }}
IMAGE_TAG: ${{ needs.create-app-env.outputs.image-tag }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPO_NAME }}
run: |
cd deployments
cp ${EB_ENVIRONMENT_NAME}/*.config .ebextensions/
sed -i -e "s|{RepositoryName}|$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG|g" docker-compose.yml
sed -i -e "s|{EBEnvironment}|$EB_ENVIRONMENT_NAME|g" docker-compose.yml
eb deploy ${EB_ENVIRONMENT_NAME} --timeout=20 --process
1 change: 1 addition & 0 deletions .github/workflows/rails-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ jobs:
public/packs
public/assets
tmp/cache/assets
public/packs-test
key: asset-precompile-cache-${{ hashFiles('ASSETS_VERSION') }}
restore-keys: |
asset-precompile-cache-${{ hashFiles('ASSETS_VERSION') }}
Expand Down
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,66 @@
# Change Log

## [v0.25.2-2022-11-08](https://github.com/codeforjapan/decidim-cfj/releases/tag/v0.25.2-2022-11-08)

### Added
- Add notification to slack [#452](https://github.com/codeforjapan/decidim-cfj/pull/452)
- Add task comment:remove_orphans [#454](https://github.com/codeforjapan/decidim-cfj/pull/454)
- Add comments for Decidim::ImageUploader in UPGRADE.md [#458](https://github.com/codeforjapan/decidim-cfj/pull/458)
- feat: add slack env [#459](https://github.com/codeforjapan/decidim-cfj/pull/459)
- feat: add print css [#460](https://github.com/codeforjapan/decidim-cfj/pull/460)

### Changed
- refactor: change image upload size limit [#455](https://github.com/codeforjapan/decidim-cfj/pull/455)


### Fixed
- locale: fix term census [#456](https://github.com/codeforjapan/decidim-cfj/pull/456)
- locale: fix collaborative_draft [#457](https://github.com/codeforjapan/decidim-cfj/pull/457)

## [v0.25.2-2022-10-25](https://github.com/codeforjapan/decidim-cfj/releases/tag/v0.25.2-2022-10-25)

### Added
- feat: add support for heic format [#438](https://github.com/codeforjapan/decidim-cfj/pull/438)
- Make frequncy of puma-worker-killer 60(sec) [#451](https://github.com/codeforjapan/decidim-cfj/pull/451)

### Changed
- Update actions/checkout and actions/setup-node [#441](https://github.com/codeforjapan/decidim-cfj/pull/441)

### Fixed
- Fix nginx.conf; add $proxy_port to Host header [#440](https://github.com/codeforjapan/decidim-cfj/pull/440)
- Fix/production nginx.conf [#442](https://github.com/codeforjapan/decidim-cfj/pull/442)
- hotfix: deployments nginx conf [#443](https://github.com/codeforjapan/decidim-cfj/pull/443)
- Refactor/some fix [#444](https://github.com/codeforjapan/decidim-cfj/pull/444)
- fix: user upload image error [#445](https://github.com/codeforjapan/decidim-cfj/pull/445)
- Fix #446; set max_complexity after initializers [#450](https://github.com/codeforjapan/decidim-cfj/pull/450)


## [v0.25.2-2022-09-29](https://github.com/codeforjapan/decidim-cfj/releases/tag/v0.25.2-2022-09-29)

### Added
- feat: add replace to null ParticipatoryProcess command [#423](https://github.com/codeforjapan/decidim-cfj/pull/423)
- feat: add replace to null decidim_proposals command [#436](https://github.com/codeforjapan/decidim-cfj/pull/436)

### Changed
- Remove ProcessParticipatorySpacePrivateUserImportCsv [#428](https://github.com/codeforjapan/decidim-cfj/pull/428)
- Add some items in UPGRADE.md [#431](https://github.com/codeforjapan/decidim-cfj/pull/431)
- Remove _main_footer.html.erb patch file; already fixed in #138 [#435](https://github.com/codeforjapan/decidim-cfj/pull/435)

### Fixed
- Revert #210; Fixed in v0.25.2 [#429](https://github.com/codeforjapan/decidim-cfj/pull/429)
- Fix paths in UPGRADE.md [#430](https://github.com/codeforjapan/decidim-cfj/pull/430)
- doc: Remove fixed(removed) files in UPGRADE.md [#432](https://github.com/codeforjapan/decidim-cfj/pull/432)

## [v0.25.2-2022-09-16](https://github.com/codeforjapan/decidim-cfj/releases/tag/v0.25.2-2022-09-16)

### Added
- Set max_complexity of GraphQL::Schema [#426](https://github.com/codeforjapan/decidim-cfj/pull/426)

## [v0.25.2-2022-09-15](https://github.com/codeforjapan/decidim-cfj/releases/tag/v0.25.2-2022-09-15)

### Added
- feat: add replace to null ParticipatoryProcess command [#423](https://github.com/codeforjapan/decidim-cfj/pull/423)

## [v0.25.2-2022-09-09](https://github.com/codeforjapan/decidim-cfj/releases/tag/v0.25.2-2022-09-09)

### Added
Expand Down
21 changes: 0 additions & 21 deletions app/packs/src/application.js

This file was deleted.

Empty file removed app/packs/src/decidim/.keep
Empty file.
60 changes: 0 additions & 60 deletions app/packs/src/decidim/decidim_awesome/editors/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,66 +40,6 @@ export function destroyQuillEditor(container) {

export function createQuillEditor(container) {
// decidim-cfj custom start
function __createCSS() {
var css = document.createElement("style")
css.type = "text/css"
css.innerText = `
.ql-html-overlayContainer {
background: #0000007d;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
}
.ql-html-popupContainer {
background: #ddd;
position: absolute;
top: 5%;
left: 5%;
right: 5%;
bottom: 5%;
border-radius: 10px;
}
.ql-html-textContainer {
position: relative;
width: calc(100% - 40px);
height: calc(100% - 40px);
padding: 20px;
}
.ql-html-textArea {
background: #fff;
position: absolute;
left: 15px;
width: calc(100% - 45px);
height: calc(100% - 116px);
}
.ql-html-buttonCancel {
margin-right: 20px;
}
.ql-html-popupTitle {
margin: 0;
display: block;
}
.ql-html-buttonGroup {
position: absolute;
bottom: 20px;
transform: scale(1.5);
left: calc(50% - 60px);
}
`;
document.head.appendChild(css);
}
__createCSS();


function $create(elName) {
return document.createElement(elName);
}
Expand Down
16 changes: 0 additions & 16 deletions app/packs/stylesheets/application.css

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion app/packs/stylesheets/decidim/_decidim-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// To override styles use decidim_application.scss
//
// By default this is empty.
@import "../decidim";
@import "./cfj/settings";
24 changes: 24 additions & 0 deletions app/packs/stylesheets/decidim/admin/application.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@import "stylesheets/decidim/admin/decidim";
@import "stylesheets/decidim/admin/extra/action-icon";
@import "stylesheets/decidim/admin/extra/block_user";
@import "stylesheets/decidim/admin/extra/cards";
@import "stylesheets/decidim/admin/extra/categories";
@import "stylesheets/decidim/admin/extra/dropdown_inverted";
@import "stylesheets/decidim/admin/extra/editor";
@import "stylesheets/decidim/admin/extra/email_preview";
@import "stylesheets/decidim/admin/extra/label-required";
@import "stylesheets/decidim/admin/extra/login";
@import "stylesheets/decidim/admin/extra/logs";
@import "stylesheets/decidim/admin/extra/newsletter-templates-gallery";
@import "stylesheets/decidim/admin/extra/organization-appearance";
@import "stylesheets/decidim/admin/extra/quill";
@import "stylesheets/decidim/admin/extra/select_multiple";
@import "stylesheets/decidim/admin/extra/show_email";
@import "stylesheets/decidim/admin/extra/sort";
@import "stylesheets/decidim/admin/extra/title_bar";

@import "stylesheets/decidim/cfj/ql_html_editor";

// This imports all the Decidim module stylesheet imports registered at
// `config/assets.rb` of the module for the "admin" group.
@import "!decidim-style-imports[admin]";
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 799e07d

Please sign in to comment.