diff --git a/.github/workflows/prod-deploy.yml b/.github/workflows/prod-deploy.yml index aae4866..027973a 100644 --- a/.github/workflows/prod-deploy.yml +++ b/.github/workflows/prod-deploy.yml @@ -11,13 +11,13 @@ on: jobs: deploy-prod: name: Deploy to prod - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: prod # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -51,8 +51,14 @@ jobs: ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router STRIPE_WEBHOOK_SECRET=${{ secrets.STRIPE_WEBHOOK_SECRET }}" ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router STRIPE_WEBHOOK_PATH=${{ secrets.STRIPE_WEBHOOK_PATH }}" ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router PYTHON_LOG_LEVEL=${{ secrets.PYTHON_LOG_LEVEL }}" - ssh dokku@$DOKKU_HOST -C "dokku ps:set-restart-policy prod-stripe-connect-webhook-endpoint-router unless-stopped" + ssh dokku@$DOKKU_HOST -C "dokku ps:set prod-stripe-connect-webhook-endpoint-router restart-policy unless-stopped" + ssh dokku@$DOKKU_HOST -C "dokku git:sync --build prod-stripe-connect-webhook-endpoint-router https://github.com/Subscribie/stripe-connect-webhook-endpoint-router.git main" ssh dokku@$DOKKU_HOST -C "dokku ps:rebuild prod-stripe-connect-webhook-endpoint-router" + ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart prod-stripe-connect-webhook-endpoint-router DOKKU_LETSENCRYPT_EMAIL=${{ secrets.LETSENCRYPT_EMAIL }}" + ssh dokku@$DOKKU_HOST -C "dokku letsencrypt:enable prod-stripe-connect-webhook-endpoint-router" | true + ssh dokku@$DOKKU_HOST -C "dokku letsencrypt:cron-job --add" + + - id: deploy name: Deploy to dokku diff --git a/.github/workflows/testing-deploy.yml b/.github/workflows/testing-deploy.yml index 6658b13..8197e2e 100644 --- a/.github/workflows/testing-deploy.yml +++ b/.github/workflows/testing-deploy.yml @@ -13,13 +13,13 @@ on: jobs: deploy-testing: name: Deploy to testing - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: testing # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -53,8 +53,12 @@ jobs: ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart testing-stripe-connect-webhook-endpoint-router STRIPE_WEBHOOK_SECRET=${{ secrets.STRIPE_WEBHOOK_SECRET }}" ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart testing-stripe-connect-webhook-endpoint-router STRIPE_WEBHOOK_PATH=${{ secrets.STRIPE_WEBHOOK_PATH }}" ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart testing-stripe-connect-webhook-endpoint-router PYTHON_LOG_LEVEL=${{ secrets.PYTHON_LOG_LEVEL }}" - ssh dokku@$DOKKU_HOST -C "dokku ps:set-restart-policy testing-stripe-connect-webhook-endpoint-router unless-stopped" + ssh dokku@$DOKKU_HOST -C "dokku ps:set testing-stripe-connect-webhook-endpoint-router restart-policy unless-stopped" + ssh dokku@$DOKKU_HOST -C "dokku git:sync --build testing-stripe-connect-webhook-endpoint-router https://github.com/Subscribie/stripe-connect-webhook-endpoint-router.git main" ssh dokku@$DOKKU_HOST -C "dokku ps:rebuild testing-stripe-connect-webhook-endpoint-router" + ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart testing-stripe-connect-webhook-endpoint-router DOKKU_LETSENCRYPT_EMAIL=${{ secrets.LETSENCRYPT_EMAIL }}" + ssh dokku@$DOKKU_HOST -C "dokku letsencrypt:enable testing-stripe-connect-webhook-endpoint-router" | true + ssh dokku@$DOKKU_HOST -C "dokku letsencrypt:cron-job --add" - id: deploy name: Deploy to dokku diff --git a/Dockerfile b/Dockerfile index 7084b60..7ff88e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ FROM python:3.6.8-alpine3.9 WORKDIR /usr/src/app RUN apk add --update --no-cache build-base libffi-dev openssl-dev bash gcc COPY . /usr/src/app/ -RUN export DOCKER_BUILDKIT=1 RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt RUN --mount=type=cache,target=/root/.cache/pip pip install uWSGI==2.0.19.1 EXPOSE 80