-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (44 loc) · 1.61 KB
/
staging.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
name: Publish and deploy staging image
on:
push:
branches:
- main
tags:
- '!**'
env:
IMAGE_NAME: 'web/smartweb/mutual'
REGISTRY_URL: ${{ secrets.HARBOR_URL }}
jobs:
build-push:
runs-on: gha-runners-smartweb
if: contains(github.event.head_commit.message, 'Back to development:') == false && contains(github.event.head_commit.message, 'Preparing release') == false
steps:
- name: Build tags
run: |
{
echo 'IMAGE_TAGS<<EOF'
echo '${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:staging'
echo '${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:staging-${{ github.run_number }}'
echo EOF
} >> $GITHUB_ENV
- name: Build push and notify
uses: IMIO/gha/[email protected]
with:
IMAGE_NAME: ${{ env.IMAGE_NAME }}
IMAGE_TAGS: ${{ env.IMAGE_TAGS }}
REGISTRY_URL: ${{ env.REGISTRY_URL}}
REGISTRY_USERNAME: ${{ secrets.SMARTWEB_HARBOR_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.SMARTWEB_HARBOR_PASSWORD }}
MATTERMOST_WEBHOOK_URL: ${{ secrets.SMARTWEB_MATTERMOST_WEBHOOK_URL }}
deploy:
runs-on: gha-runners-smartweb
needs: build-push
steps:
- name: Deploy to staging and notify
uses: IMIO/gha/[email protected]
with:
RUNDECK_URL: ${{ secrets.RUNDECK_URL }}
RUNDECK_TOKEN: ${{ secrets.SMARTWEB_RUNDECK_TOKEN }}
RUNDECK_JOB_ID: ${{ secrets.RUNDECK_DEPLOY_STAGING_JOB_ID }}
RUNDECK_PARAMETERS: '-X POST'
MATTERMOST_WEBHOOK_URL: ${{ secrets.SMARTWEB_MATTERMOST_WEBHOOK_URL }}