-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (57 loc) · 1.77 KB
/
deploy-dev.yaml
File metadata and controls
59 lines (57 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build and Deploy dev environment
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Registry
uses: docker/login-action@v2
with:
registry: registry.camph.net
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Check out
uses: actions/checkout@v3
- name: Get short SHA
id: slug
shell: bash
run: echo "::set-output name=sha::${GITHUB_SHA::7}"
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: registry.camph.net/relaym-server-dev:${{ steps.slug.outputs.sha }}
context: .
file: ./docker/Dockerfile
- name: Notify to Slack
uses: craftech-io/slack-action@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure()
- name: Update k8s yaml
uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'camphor-',
repo: 'konoe-k8s',
workflow_id: 'update-image.yaml',
ref: 'master',
inputs: {
directory: 'relaym-server-dev/base',
image: 'registry.camph.net/relaym-server-dev:${{ steps.slug.outputs.sha }}'
}
});
- name: Notify to Slack
uses: craftech-io/slack-action@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()