* Small fix #22
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: Push | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
jobs: | |
my-deployment: | |
name: deploy to production | |
runs-on: ubuntu-latest | |
steps: | |
# - run: apk update | |
- uses: docker-practice/actions-setup-docker@master | |
timeout-minutes: 12 | |
- uses: actions/checkout@v3 | |
- uses: webfactory/ssh-agent@v0.8.0 | |
with: | |
ssh-private-key: ${{ secrets.WWF_SSH_PRIVATE_KEY }} | |
- run: mkdir -p ~/.ssh | |
- run: echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config | |
- run: ssh ${{ secrets.WWF_SSH_USERNAME }}@${{ secrets.WWF_SERVER }} "mkdir -p ./merci" | |
- run: docker context create remote --docker "host=ssh://${{ secrets.WWF_SSH_USERNAME }}@${{ secrets.WWF_SERVER }}" | |
- run: docker --context remote compose -f docker-compose.yml build | |
# as we can't set --project-directory for a remote context, we have to use "ssh" to run docker compose | |
- run: scp ./docker-compose.yml ${{ secrets.WWF_SSH_USERNAME }}@${{ secrets.WWF_SERVER }}:~/ | |
- run: ssh ${{ secrets.WWF_SSH_USERNAME }}@${{ secrets.WWF_SERVER }} "docker compose -f docker-compose.yml up -d --force-recreate" | |
- run: docker --context remote image prune -a -f | |
- run: docker --context remote image container -a -f | |
- run: docker --context remote volume prune -a -f |