diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index def96d8..9e360a3 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -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: . @@ -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 }} @@ -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