Skip to content

Commit

Permalink
Port to next
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Acierno <marcoaciernoemail@gmail.com>
  • Loading branch information
patrick91 and marcoacierno authored Oct 30, 2020
1 parent 2b370de commit d0c8702
Show file tree
Hide file tree
Showing 293 changed files with 11,016 additions and 21,588 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/backend-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: '3.7.6'
python-version: '3.7.9'
- run: pip install poetry

- name: Cache Poetry
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/backend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:

steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: '3.7.6'
python-version: '3.7.9'
- run: pip install poetry

- name: Cache Poetry
Expand Down Expand Up @@ -72,9 +72,9 @@ jobs:

steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: '3.7.6'
python-version: '3.7.9'
- run: pip install poetry
- name: Install dependencies
working-directory: backend
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/cron-deploy-frontend.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/deploy-pretix.yml

This file was deleted.

143 changes: 51 additions & 92 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,112 +12,71 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Docker login
run:
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Build the Docker image
working-directory: backend
run:
docker build . --file Dockerfile --tag pythonitalia/pycon-backend:latest
run: docker build . --file Dockerfile --tag pythonitalia/pycon-backend:latest
- name: Publish the image
working-directory: backend
run:
docker push pythonitalia/pycon-backend:latest
run: docker push pythonitalia/pycon-backend:latest

terraform:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: terraform-init
uses: hashicorp/terraform-github-actions/init@v0.3.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_ACTION_WORKING_DIR: ./infrastructure

- name: terraform-validate
uses: hashicorp/terraform-github-actions/validate@v0.3.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_ACTION_WORKING_DIR: ./infrastructure
- uses: actions/checkout@master

- name: terraform-apply
uses: hashicorp/terraform-github-actions/apply@v0.3.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_VAR_database_password: ${{ secrets.TF_VAR_database_password }}
TF_VAR_secret_key: ${{ secrets.TF_VAR_secret_key }}
TF_VAR_ssl_certificate: ${{ secrets.TF_VAR_ssl_certificate }}
TF_VAR_mapbox_public_api_key: ${{ secrets.TF_VAR_mapbox_public_api_key }}
TF_VAR_sentry_dsn: ${{ secrets.TF_VAR_sentry_dsn }}
TF_VAR_slack_incoming_webhook_url: ${{ secrets.TF_VAR_slack_incoming_webhook_url }}
TF_VAR_social_auth_google_oauth2_key: ${{ secrets.TF_VAR_social_auth_google_oauth2_key }}
TF_VAR_social_auth_google_oauth2_secret: ${{ secrets.TF_VAR_social_auth_google_oauth2_secret }}
TF_VAR_mail_user: ${{ secrets.TF_VAR_mail_user }}
TF_VAR_mail_password: ${{ secrets.TF_VAR_mail_password }}
TF_VAR_pretix_secret_key: ${{ secrets.TF_VAR_pretix_secret_key }}
TF_VAR_pretix_api_token: ${{ secrets.TF_VAR_pretix_api_token }}
TF_VAR_pinpoint_application_id: ${{ secrets.TF_VAR_pinpoint_application_id }}
TF_ACTION_WORKING_DIR: ./infrastructure
TF_ACTION_WORKSPACE: production
- name: terraform-init
uses: hashicorp/terraform-github-actions/init@v0.3.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_ACTION_WORKING_DIR: ./infrastructure

- name: terraform-validate
uses: hashicorp/terraform-github-actions/validate@v0.3.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_ACTION_WORKING_DIR: ./infrastructure

- name: terraform-apply
uses: hashicorp/terraform-github-actions/apply@v0.3.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_VAR_database_password: ${{ secrets.TF_VAR_database_password }}
TF_VAR_secret_key: ${{ secrets.TF_VAR_secret_key }}
TF_VAR_ssl_certificate: ${{ secrets.TF_VAR_ssl_certificate }}
TF_VAR_mapbox_public_api_key: ${{ secrets.TF_VAR_mapbox_public_api_key }}
TF_VAR_sentry_dsn: ${{ secrets.TF_VAR_sentry_dsn }}
TF_VAR_slack_incoming_webhook_url: ${{ secrets.TF_VAR_slack_incoming_webhook_url }}
TF_VAR_social_auth_google_oauth2_key: ${{ secrets.TF_VAR_social_auth_google_oauth2_key }}
TF_VAR_social_auth_google_oauth2_secret: ${{ secrets.TF_VAR_social_auth_google_oauth2_secret }}
TF_VAR_mail_user: ${{ secrets.TF_VAR_mail_user }}
TF_VAR_mail_password: ${{ secrets.TF_VAR_mail_password }}
TF_VAR_pretix_secret_key: ${{ secrets.TF_VAR_pretix_secret_key }}
TF_VAR_pretix_api_token: ${{ secrets.TF_VAR_pretix_api_token }}
TF_VAR_pinpoint_application_id: ${{ secrets.TF_VAR_pinpoint_application_id }}
TF_ACTION_WORKING_DIR: ./infrastructure
TF_ACTION_WORKSPACE: production

deploy-to-eb:
runs-on: ubuntu-latest
needs: [terraform, build-and-push-backend]

steps:
- uses: actions/checkout@master

- name: eb deploy
uses: ./.github/eb-action
with:
env: backend
args: deploy production-env --region eu-central-1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

deploy-site:
needs: [deploy-to-eb]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- run: yarn
working-directory: frontend

- run: yarn codegen-fragments
working-directory: frontend
env:
API_URL: https://d1111jewijk23m.cloudfront.net/graphql
- uses: actions/checkout@master

- run: yarn build
working-directory: frontend
env:
CONFERENCE_CODE: pycon11
API_URL: https://d1111jewijk23m.cloudfront.net/graphql
API_TOKEN: ${{ secrets.API_TOKEN }}
SENTRY_DSN: ${{ secrets.TF_VAR_sentry_dsn }}
- uses: netlify/actions/cli@master
with:
args: deploy --dir=frontend/public --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: eb deploy
uses: ./.github/eb-action
with:
env: backend
args: deploy production-env --region eu-central-1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Loading

1 comment on commit d0c8702

@vercel
Copy link

@vercel vercel bot commented on d0c8702 Oct 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.