Skip to content

Commit

Permalink
Replace deploy workflows.
Browse files Browse the repository at this point in the history
And get rid of Postgres (add Framerail).
  • Loading branch information
emmiegit committed Apr 24, 2024
1 parent c37943d commit c926d0f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 104 deletions.
53 changes: 11 additions & 42 deletions .github/workflows/docker-build-push-api.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DOCKER_PUSH_KEY }}
aws-secret-access-key: ${{ secrets.DOCKER_PUSH_SECRET }}
aws-region: us-east-2

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

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
DOCKER_BUILDKIT: 1
ECR_REGISTRY: ${{ vars.ECR_REPOSITORY }}
ECR_REPOSITORY: wikijump/deepwell
IMAGE_TAG: ${{ github.sha }}
run: |
set -ex
docker build -f install/aws/dev/docker/api/Dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:dev .
docker push $ECR_REGISTRY/$ECR_REPOSITORY --all-tags
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Download task definition
- name: Set up deployment environment
run: |
aws ecs describe-task-definition --task-definition wikijump-deepwell-dev --query taskDefinition > task-definition.json
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: deepwell
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: wikijump-deepwell-dev
cluster: wikijump-dev
wait-for-service-stability: true
echo "$DOKKU_DEPLOY_KEY" > ~/.ssh/ssh-deploy
echo 'Host wikijump.dev' >> ~/.ssh/config
echo ' HostName wikijump.dev' >> ~/.ssh/config
echo ' User linuxuser' >> ~/.ssh/config
echo ' IdentityFile ~/.ssh/ssh-deploy' >> ~/.ssh/config
echo ' IdentitiesOnly yes' >> ~/.ssh/config
git remote add dokku [email protected]:deepwell
- name: Deploy to Dokku
run: git push dokku HEAD:master
62 changes: 0 additions & 62 deletions .github/workflows/docker-build-push-postgres.dev.yaml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/docker-build-push-web.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: '[backend] Docker push Framerail'

on:
push:
branches:
- develop
paths:
- 'framerail/**'
- 'install/aws/dev/docker/web/**'
- '.github/workflows/docker-build-push-web.dev.yaml'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up deployment environment
run: |
echo "$DOKKU_DEPLOY_KEY" > ~/.ssh/ssh-deploy
echo 'Host wikijump.dev' >> ~/.ssh/config
echo ' HostName wikijump.dev' >> ~/.ssh/config
echo ' User linuxuser' >> ~/.ssh/config
echo ' IdentityFile ~/.ssh/ssh-deploy' >> ~/.ssh/config
echo ' IdentitiesOnly yes' >> ~/.ssh/config
git remote add dokku [email protected]:framerail
- name: Deploy to Dokku
run: git push dokku HEAD:master

0 comments on commit c926d0f

Please sign in to comment.