Skip to content

Commit

Permalink
docker pswd manager
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush7833 committed Jun 9, 2024
1 parent 57785ef commit 5367a69
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,10 @@ jobs:
cd test
go test -run TestOrder
- name: Install pass and set up GPG
run: |
sudo apt-get update
sudo apt-get install -y pass gnupg2
gpg --batch --gen-key <<-EOF
Key-Type: default
Subkey-Type: default
Name-Real: Docker Credential Helper
Name-Email: [email protected]
Expire-Date: 0
%no-protection
EOF
gpg --list-secret-keys --keyid-format LONG
GPG_KEY_ID=$(gpg --list-secret-keys --keyid-format LONG | grep "sec rsa" | awk '{print $2}' | cut -d '/' -f 2)
pass init $GPG_KEY_ID
- name: Set Up Docker Credential Helper
run: |
mkdir -p ~/.docker
echo '{"credsStore":"pass"}' > ~/.docker/config.json
- name: Build and push Docker image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/main'
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -63,8 +44,8 @@ jobs:
run: |
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
docker build --build-arg JWT_SECRET=${JWT_SECRET} --build-arg DB_URI=${DB_URI} -t piyush7833/chat-api:latest .
docker tag piyush7833/chat-api:latest docker.io/piyush7833/chat-api:latest
docker push docker.io/piyush7833/chat-api:latest
docker push piyush7833/chat-api:latest

- name: Update ECS task definition and service
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand Down

0 comments on commit 5367a69

Please sign in to comment.