forked from alerta/alerta
-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (46 loc) · 1.6 KB
/
push-onto-master.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
45
46
name: Pull Request Onto Develop
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Set private key
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.GIT_SSH_KEY }}
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
- run: git fetch --all --tags
- name: Check Release Version
uses: thebongy/version-check@v1
with:
file: package.json
tagFormat: v${version}
failBuild: true
id: version_check_staging
- run: |
docker login --username rudderlabs --password '${{ secrets.DOCKER_HUB_PASSWORD }}'
export VERSION=${{steps.version_check_staging.outputs.releaseVersion}}
rm -rf rudder-alerta-enrichment-plugin
git clone -b "$(cat RUDDER_ENRICH_PLUGIN_BRANCH_NAME)" https://${{ secrets.PAT_USERNAME }}:${{ secrets.PAT }}@github.com/rudderlabs/rudder-alerta-enrichment-plugin.git
docker build --no-cache --build-arg=COMMIT_ID_VALUE="$(git log --format="%H" -n 1)" -t rudderlabs/alerta:$VERSION .
docker push rudderlabs/alerta:$VERSION
rm -rf rudder-alerta-enrichment-plugin
name: Docker build and push
- name: Create tag
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{steps.version_check_staging.outputs.releaseVersion}}',
sha: context.sha
})