Skip to content

Commit

Permalink
workflows/main: add discord webhook steps
Browse files Browse the repository at this point in the history
Currently doesn't continue on failure for live testing. Testing in
production! (Well it worked for my local test at least!)
  • Loading branch information
ihaveamac committed Oct 6, 2020
1 parent deb875b commit 6452a36
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Send job start webhook
continue-on-error: false
uses: appleboy/discord-action@4c19612
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
message: Starting build for commit ${{ github.sha }}
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
Expand All @@ -35,6 +42,13 @@ jobs:
build-args: COMMIT=${{ github.sha }},BRANCH=${{ github.ref }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Send push webhook
continue-on-error: false
uses: appleboy/discord-action@4c19612
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
message: Pushing to ghcr.io/nh-server/kurisu
- name: Push Docker image
run: docker push ghcr.io/nh-server/kurisu:latest
# https://stackoverflow.com/questions/60477061/github-actions-how-to-deploy-to-remote-server-using-ssh/60479844#60479844
Expand All @@ -49,10 +63,24 @@ jobs:
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Send push webhook
continue-on-error: false
uses: appleboy/discord-action@4c19612
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
message: Pulling on server
- name: Pull on server
run: docker-compose pull
env:
DOCKER_HOST: ${{ secrets.SSH_HOST }}
- name: Send up webhook
continue-on-error: false
uses: appleboy/discord-action@4c19612
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
message: Running on server
- name: Run on server
run: docker-compose up -d
env:
Expand Down

0 comments on commit 6452a36

Please sign in to comment.