Modifico comando del login to Dockerhub #6
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: CI Pipeline - Prov QA | |
on: | |
push: | |
branches: | |
- martin-prov-qa | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.PEM_PROV_QA }} | |
REMOTE_USER: ec2-user | |
REMOTE_HOST: ${{ secrets.IP_PROV_QA }} | |
GH_TOKEN: ${{ secrets.TOKEN_PROV }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Docker | |
run: | | |
sudo apt-get update | |
sudo apt-get remove -y containerd.io # Elimina containerd.io si está instalado | |
sudo apt-get install -y docker.io | |
- name: Build Docker Image | |
run: | | |
docker build -t imagen-prov-qa . | |
- name: Login to Docker Hub | |
run: echo "${{ secrets.TOKEN_PROV_QA }}" | docker login -u 471626 --password-stdin | |
- name: Push to Docker Hub | |
run: docker push 471626/imagen-prov-qa | |
- name: Deploy to QA Environment | |
run: | | |
ssh -i C:\Users\marti\Downloads\PEM_PROV_QA.pem [email protected] 'docker pull 471626/imagen-prov-qa && docker run -d -p 3000:3000 471626/imagen-prov-qa' | |
- name: Verify Service is Running | |
run: | | |
ssh -i C:\Users\marti\Downloads\PEM_PROV_QA.pem [email protected] 'docker ps -a' |