fix: aws condential #142
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deployment | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
Deploy: | |
name: Deploy branch main | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: verify credentials | |
run: aws s3 ls | |
- name: appleboy-ssh | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.HOST_USERNAME }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
script: | | |
cd python-uri-shortener | |
echo "Welcome!" | |
git pull origin main | |
docker system prune -a -f | |
docker-compose down | |
docker pull nginx:latest | |
docker login -u stefnie -p ${{ secrets.docker_hub_token }} | |
docker pull stefnie/uri-image:latest | |
docker pull stefnie/api-image:latest | |
docker-compose -f compose.yaml up -d |