Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
k4mien committed Jan 26, 2024
1 parent 22cef5f commit 198ff1f
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Create .env files with secrets
run: |
echo "${{ secrets.ENV_FILE_LAVALINK }}">> application.env
echo "${{ secrets.ENV_FILE_BOT }}">> bot.env
echo "IMAGE=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG">> .env
echo "token=$(echo aws ecr get-login-password)">> $GITHUB_ENV
echo "${{ env.token }}"
- name: SCP docker compose and lavalink config to server
uses: appleboy/[email protected]
Expand All @@ -88,14 +79,16 @@ jobs:
- name: SSH into EC2 instance and deploy
uses: appleboy/[email protected]
env:
ECR_TOKEN: ${{ env.token }}
USERNAME: ${{ secrets.EC2_USERNAME }}
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
echo $ECR_TOKEN | docker login -u $USERNAME --password-stdin $ECR_REGISTRY
aws configure set aws_access_key_id "${{ secrets.AWS_ACCESS_KEY_ID }}"
aws configure set aws_secret_access_key "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
aws configure set region "${{ secrets.AWS_REGION }}"
docker login -u $USERNAME --password-stdin $ECR_REGISTRY
cd ~/.deploy/djs/
docker compose -f compose-prod-aws.yml pull
docker compose -f compose-prod-aws.yml up -d

0 comments on commit 198ff1f

Please sign in to comment.