Skip to content

Commit

Permalink
Merge pull request #546 from project-violet/server-cd
Browse files Browse the repository at this point in the history
Recover violet-server cd
  • Loading branch information
violet-dev authored Sep 21, 2024
2 parents 11f2f2a + 47c2f81 commit b1e6eb5
Showing 1 changed file with 31 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
name: ci
name: Server CD

on:
push:
branches:
- 'master'
paths-ignore:
- 'README.md'
- "dev"
workflow_dispatch:

jobs:
docker:
server-changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}

# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- ".github/workflows/server-cd.yml"
- "violet-server/**"
deploy-by-docker:
needs: server-changes
if: ${{ needs.app-changes.outputs.src == 'true' }}
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -32,14 +54,15 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}:violet-server"
push: true
tags: violetdev/violet:latest

- name: Diploy
uses: fjogeleit/http-request-action@v1
with:
url: ${{ secrets.WEBHOOK_URL }}
method: 'POST'
method: "POST"
timeout: 60000

- name: CD Success
Expand All @@ -51,7 +74,7 @@ jobs:
color: 0x28e1ff
nodetail: true
description: |
Commit: [${{ github.event.head_commit.message }}](https://github.com/project-violet/violet-server-nest/commit/${{ github.sha }})
Commit: [${{ github.event.head_commit.message }}](https://github.com/project-violet/violet-server/commit/${{ github.sha }})
CI Log: [${{ github.ref }} / ${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
- name: CD Fail
Expand All @@ -64,5 +87,5 @@ jobs:
color: 0xff9300
content: "<@614104830738169877>"
description: |
Commit: [${{ github.event.head_commit.message }}](https://github.com/project-violet/violet-server-nest/commit/${{ github.sha }})
Commit: [${{ github.event.head_commit.message }}](https://github.com/project-violet/violet-server/commit/${{ github.sha }})
CI Log: [${{ github.ref }} / ${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})

0 comments on commit b1e6eb5

Please sign in to comment.