diff --git a/wien_talks/.github/workflows/deployment-aws.yml b/wien_talks/.github/workflows/deployment-aws.yml deleted file mode 100644 index ea95cd7..0000000 --- a/wien_talks/.github/workflows/deployment-aws.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Deploy to AWS -on: - push: - branches: [ deployment-aws-production, deployment-aws-staging ] - workflow_dispatch: - inputs: - target: - description: 'Target' - required: true - default: 'production' - type: choice - options: - - 'staging' - - 'production' -jobs: - deploy: - name: Deploy to AWS - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Setup Dart SDK - uses: dart-lang/setup-dart@v1.6.5 - with: - sdk: 3.5 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-2 - - - name: Create passwords file - working-directory: wien_talks_server - shell: bash - env: - SERVERPOD_PASSWORDS: ${{ secrets.SERVERPOD_PASSWORDS }} - run: | - pwd - echo "$SERVERPOD_PASSWORDS" > config/passwords.yaml - ls config/ - - - name: Get Dart packages - working-directory: wien_talks_server - run: dart pub get - - - name: Compile server - working-directory: wien_talks_server - run: dart compile kernel bin/main.dart - - - name: Create CodeDeploy Deployment - id: deploy - env: - PROJECT_NAME: wien_talks - AWS_NAME: wien-talks - DEPLOYMENT_BUCKET: wien-talks-deployment-6559518 - TARGET: ${{ github.event.inputs.target }} - run: | - # Deploy server to AWS - TARGET="${TARGET:=${GITHUB_REF##*-}}" - echo "Deploying to target: $TARGET" - mkdir -p vendor - cp "${PROJECT_NAME}_server/deploy/aws/scripts/appspec.yml" appspec.yml - zip -r deployment.zip . - aws s3 cp deployment.zip "s3://${DEPLOYMENT_BUCKET}/deployment.zip" - aws deploy create-deployment \ - --application-name "${AWS_NAME}-app" \ - --deployment-group-name "${AWS_NAME}-${TARGET}-group" \ - --deployment-config-name CodeDeployDefault.OneAtATime \ - --s3-location "bucket=${DEPLOYMENT_BUCKET},key=deployment.zip,bundleType=zip" diff --git a/wien_talks/.github/workflows/deployment-gcp.yml b/wien_talks/.github/workflows/deployment-gcp.yml deleted file mode 100644 index 6ceedf2..0000000 --- a/wien_talks/.github/workflows/deployment-gcp.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Deploy to GCP -on: - push: - branches: [ deployment-gcp-production, deployment-gcp-staging ] - workflow_dispatch: - inputs: - target: - description: 'Target' - required: true - default: 'production' - type: choice - options: - - 'staging' - - 'production' - -env: - # TODO: Update with your Google Cloud project id. If you have changed the - # region and zone in your Terraform configuration, you will need to change - # it here too. - PROJECT: "" - REGION: us-central1 - ZONE: us-central1-c - -jobs: - deploy: - name: Deploy to Google Cloud Run - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Setting Target Mode from Input - if: ${{ github.event.inputs.target != '' }} - run: echo "TARGET=${{ github.event.inputs.target }}" >> $GITHUB_ENV - - - name: Setting Target mode based on branch - if: ${{ github.event.inputs.target == '' }} - run: echo "TARGET=${GITHUB_REF##*-}" >> $GITHUB_ENV - - - name: Set repository - run: echo "REPOSITORY=serverpod-${{ env.TARGET }}-container" >> $GITHUB_ENV - - - name: Set Image Name - run: echo "IMAGE_NAME=serverpod" >> $GITHUB_ENV - - - name: Set Service Name - run: echo "SERVICE_NAME=$(echo $IMAGE_NAME | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_ENV - - - name: Test - run: echo $SERVICE_NAME - - - - id: "auth" - name: "Authenticate to Google Cloud" - uses: "google-github-actions/auth@v1" - with: - credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}" - - - name: Create passwords file - working-directory: wien_talks_server - shell: bash - env: - SERVERPOD_PASSWORDS: ${{ secrets.SERVERPOD_PASSWORDS }} - run: | - pwd - echo "$SERVERPOD_PASSWORDS" > config/passwords.yaml - ls config/ - - - name: Configure Docker - working-directory: wien_talks_server - run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev - - - name: Build the Docker image - working-directory: wien_talks_server - run: "docker build -t $IMAGE_NAME ." - - - name: Tag the Docker image - working-directory: wien_talks_server - run: docker tag $IMAGE_NAME ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT }}/${{ env.REPOSITORY }}/$IMAGE_NAME - - - name: Push Docker image - working-directory: wien_talks_server - run: docker push ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT }}/${{ env.REPOSITORY }}/$IMAGE_NAME - - # Uncomment the following code to automatically restart the servers in the - # instance group when you push a new version of your code. Before doing - # this, make sure that you have successfully deployed a first version. - # - # - name: Restart servers in instance group - # run: | - # gcloud compute instance-groups managed rolling-action replace serverpod-${{ env.TARGET }}-group \ - # --project=${{ env.PROJECT }} \ - # --replacement-method='substitute' \ - # --max-surge=1 \ - # --max-unavailable=1 \ - # --zone=${{ env.ZONE }}