Skip to content

Commit

Permalink
Merge pull request #15 from MinusFour/fix-workflow-rpi-3
Browse files Browse the repository at this point in the history
[fix] Recrear contenedores con docker-compose
  • Loading branch information
MinusFour authored Sep 25, 2020
2 parents fb48df8 + 683f9f3 commit b1291a2
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
-
name: Login to GHCR
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}
-
uses: docker/setup-qemu-action@v1
- uses: docker/setup-qemu-action@v1
with:
platforms: all
-
name: Create builder
- name: Create builder
uses: docker/setup-buildx-action@v1

-
name: Build and push docker image
- uses: satackey/action-docker-layer-caching@v0.0.8
continue-on-error: true

- name: Build and push docker image
uses: docker/build-push-action@v2
with:
context: .
Expand All @@ -43,8 +42,7 @@ jobs:
SSH_PORT: ${{ secrets.SSH_PORT }}
steps:
- uses: actions/checkout@v2
-
name: Set SSH client
- name: Set SSH client
env:
SSH_PRIVATE_KEY: ${{ secrets.GA_PRIV_KEY }}
HOST_KEY: ${{ secrets.HOST_KEY }}
Expand All @@ -58,18 +56,15 @@ jobs:
echo "$SSH_HOST $HOST_KEY" > $HOME/.ssh/known_hosts
echo ::set-env name=SSH_AUTH_SOCK::$SSH_AUTH_SOCK
echo ::set-env name=SSH_AGENT_PID::$SSH_AGENT_PID
-
name: Set DOCKER_HOST
- name: Set DOCKER_HOST
run: echo "::set-env name=DOCKER_HOST::ssh://$SSH_USER@$SSH_HOST:$SSH_PORT"
-
name: Login to GHCR
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}
-
name: Pull image and run in host
- name: Pull image and run in host
run: |
docker-compose pull
docker-compose up -d
docker-compose pull --quiet
docker-compose up --force-recreate -d

0 comments on commit b1291a2

Please sign in to comment.