fix image name #7
Workflow file for this run
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: Deploy to DigitalOcean | |
on: | |
push: | |
branches: | |
- setup/digital-ocean | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Docker images | |
run: docker-compose build | |
- name: Set up SSH | |
uses: webfactory/ssh-agent@v0.5.3 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Save and transfer API image to DigitalOcean | |
run: | | |
set -e | |
IMAGE_API_ID=$(docker images -q abibliadigital:latest) | |
echo "API Image ID: $IMAGE_API_ID" | |
if [ -z "$IMAGE_API_ID" ]; then | |
echo "API image not found!" | |
exit 1 | |
fi | |
docker save $IMAGE_API_ID | bzip2 | ssh root@${{ secrets.DROPLET_IP }} 'bunzip2 | docker load' | |
- name: Save and transfer Mongo image to DigitalOcean | |
run: | | |
set -e | |
IMAGE_MONGO_ID=$(docker images -q abibliadigital-mongo:latest) | |
echo "Mongo Image ID: $IMAGE_MONGO_ID" | |
if [ -z "$IMAGE_MONGO_ID" ]; then | |
echo "Mongo image not found!" | |
exit 1 | |
fi | |
docker save $IMAGE_MONGO_ID | bzip2 | ssh root@${{ secrets.DROPLET_IP }} 'bunzip2 | docker load' | |
- name: Deploy to DigitalOcean | |
run: | | |
ssh root@${{ secrets.DROPLET_IP }} "docker-compose -f /path/to/docker-compose.yml up -d" |