-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEVOPS-137
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Promote staging to production | ||
on: | ||
push: | ||
tags: | ||
- '**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tag: | ||
environment: | ||
name: production | ||
runs-on: | ||
group: self-hosted | ||
steps: | ||
- name: Tag and notify | ||
uses: IMIO/gha/[email protected] | ||
with: | ||
IMAGE_NAME: ${{ vars.IMAGE_NAME }} | ||
IMAGE_TAG: ${{ vars.IMAGE_TAG_STAGING }} | ||
NEW_IMAGE_TAG: ${{ vars.IMAGE_TAG_PRODUCTION }} | ||
REGISTRY_URL: ${{ secrets.HARBOR_URL }} | ||
REGISTRY_USERNAME: ${{ secrets.SMARTWEB_HARBOR_USERNAME }} | ||
REGISTRY_PASSWORD: ${{ secrets.SMARTWEB_HARBOR_PASSWORD }} | ||
MATTERMOST_WEBHOOK_URL: ${{ secrets.SMARTWEB_MATTERMOST_WEBHOOK_URL }} | ||
deploy: | ||
environment: | ||
name: production | ||
runs-on: | ||
group: self-hosted | ||
needs: [tag] | ||
steps: | ||
- name: Get tomorrow date | ||
run: echo "DEPLOY_DATE=$(date --date='03:00 tomorrow' +'%Y-%m-%dT%H:%M:%S%z')" >> $GITHUB_ENV | ||
- name: Deploy to production and notify | ||
uses: IMIO/gha/[email protected] | ||
with: | ||
RUNDECK_URL: ${{ secrets.RUNDECK_URL }} | ||
RUNDECK_TOKEN: ${{ secrets.SMARTWEB_RUNDECK_TOKEN }} | ||
RUNDECK_JOB_ID: ${{ vars.RUNDECK_JOB_ID }} | ||
RUNDECK_PARAMETERS: '-F "runAtTime=${{ env.DEPLOY_DATE }}" -F "filter=name ${{ vars.NODE_NAME }}" -F "option.tag=${{ vars.IMAGE_TAG_PRODUCTION }}" -F "option.image_name=${{ vars.IMAGE_NAME }}" -F "option.service_name=${{ vars.SERVICE_NAME }}"' | ||
MATTERMOST_WEBHOOK_URL: ${{ secrets.SMARTWEB_MATTERMOST_WEBHOOK_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Publish and deploy staging image | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '!**' | ||
workflow_dispatch: | ||
jobs: | ||
build-push: | ||
environment: staging | ||
runs-on: | ||
group: self-hosted | ||
if: contains(github.event.head_commit.message, 'Back to development:') == false && contains(github.event.head_commit.message, 'Preparing release') == false | ||
steps: | ||
- name: Build push and notify | ||
uses: IMIO/gha/[email protected] | ||
with: | ||
IMAGE_NAME: ${{ vars.IMAGE_NAME }} | ||
IMAGE_TAG: ${{ vars.IMAGE_TAG_STAGING }} | ||
REGISTRY_URL: ${{ secrets.HARBOR_URL }} | ||
REGISTRY_USERNAME: ${{ secrets.SMARTWEB_HARBOR_USERNAME }} | ||
REGISTRY_PASSWORD: ${{ secrets.SMARTWEB_HARBOR_PASSWORD }} | ||
MATTERMOST_WEBHOOK_URL: ${{ secrets.SMARTWEB_MATTERMOST_WEBHOOK_URL }} | ||
deploy: | ||
environment: | ||
name: staging | ||
runs-on: | ||
group: self-hosted | ||
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: ${{ vars.RUNDECK_JOB_ID }} | ||
RUNDECK_PARAMETERS: '-F "filter=name ${{ vars.NODE_NAME }}" -F "option.tag=${{ vars.IMAGE_TAG_STAGING }}" -F "option.image_name=${{ vars.IMAGE_NAME }}" -F "option.service_name=${{ vars.SERVICE_NAME }}"' | ||
MATTERMOST_WEBHOOK_URL: ${{ secrets.SMARTWEB_MATTERMOST_WEBHOOK_URL }} |
File renamed without changes.