Skip to content

Commit

Permalink
test ssh into ec2
Browse files Browse the repository at this point in the history
  • Loading branch information
k4mien committed Jan 22, 2024
1 parent 1cf772a commit cb66ec9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 91 deletions.
38 changes: 24 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ on:
branches: [ dev, main ]

jobs:
lint:
name: Linting

permissions:
contents: read
statuses: write

# FIXME: customize uri to point to your own reusable linter repository
uses: k4mien/super-linter-bf/.github/workflows/reusable-super-linter.yaml@main

with:
filter-regex-include: src/.*

deploy:
name: Deployment
runs-on: ubuntu-latest
Expand Down Expand Up @@ -38,18 +51,15 @@ jobs:
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- 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: discordjs
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
- name: SSH into EC2 instance and deploy
uses: appleboy/[email protected]
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: discord-bot-lavalink
cluster: discord-bot-lavalink
wait-for-service-stability: true
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
# script: |
# sudo docker pull ${{ secrets.DOCKER_REPO_URL }}/dummy-server:latest
# sudo docker stop my-node-app || true
# sudo docker rm my-node-app || true
# sudo docker run -d -p 3000:3000 --name my-node-app ${{ secrets.DOCKER_REPO_URL }}/dummy-server:latest
script: whoami
77 changes: 0 additions & 77 deletions task-definition.json

This file was deleted.

0 comments on commit cb66ec9

Please sign in to comment.