-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (38 loc) · 1.35 KB
/
cd.yaml
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
name: CD
on:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Git repository
uses: actions/checkout@v2
- name: Declare variables
id: vars
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: login to dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the stack
run: docker build -t sgt-websockets .
- name: Tag Docker images
run: |
docker tag sgt-websockets ${{ secrets.DOCKERHUB_USERNAME }}/sgt-websockets:${{ steps.vars.outputs.sha_short }}
- name: Push Docker images
run: |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/sgt-websockets:${{ steps.vars.outputs.sha_short }}
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: Shigoto-Q/sgt-infrastructure
event-type: go-result-service-build-successful
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ steps.vars.outputs.sha_short }}"}'