-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.19 KB
/
main.yml
File metadata and controls
41 lines (39 loc) · 1.19 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
name: Build and publish
on:
push:
branches: [ main ]
jobs:
BuildAndPush:
runs-on: ubuntu-latest
name: Build and Push
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push API Server
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: ghcr.io/wa2g07/traveller-service:${{ github.sha }}, ghcr.io/wa2g07/traveller-service:latest
DeploymentTrigger:
runs-on: ubuntu-latest
name: Deployment Trigger
needs:
- BuildAndPush
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.DEVOPSDISPATCHTOKEN }}
event-type: travellerservice-event
client-payload: '{"ref": "${{ github.ref }}", "tag": "${{ github.sha }}"}'
repository: wa2g07/FinalProject-DevOps