-
Notifications
You must be signed in to change notification settings - Fork 24
66 lines (57 loc) · 1.85 KB
/
build_docker_and_trigger_metplus.yml
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
60
61
62
63
64
65
66
name: Build Docker Image and Trigger METplus Workflow
on:
push:
branches:
- develop
paths-ignore:
- 'met/docs/**'
workflow_dispatch:
env:
DOCKERHUB_REPO: dtcenter/met-dev
jobs:
build_met_docker:
name: Handle Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get branch name
id: get_branch_name
run: echo branch_name=${GITHUB_REF#refs/heads/} >> $GITHUB_OUTPUT
- name: Build Docker Image
run: .github/jobs/build_docker_image.sh
env:
SOURCE_BRANCH: ${{ steps.get_branch_name.outputs.branch_name }}-lite
MET_BASE_REPO: met-base
MET_BASE_TAG: v3.1
- name: Push Docker Image
run: .github/jobs/push_docker_image.sh
env:
SOURCE_BRANCH: ${{ steps.get_branch_name.outputs.branch_name }}-lite
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
trigger_metplus:
name: Trigger METplus testing workflow
runs-on: ubuntu-latest
needs: build_met_docker
steps:
- name: Print GitHub values for reference
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.METPLUS_BOT_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'dtcenter',
repo: 'METplus',
workflow_id: 'testing.yml',
ref: 'develop',
inputs: {
repository: '${{ github.repository }}',
ref: '${{ github.ref }}',
actor: '${{ github.actor }}',
sha: '${{ github.sha }}',
pusher_email: '${{ github.event.pusher.email }}'
},
});