Merge pull request #367 from bcgov/develop #62
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
name: "Common-SSO CI" | |
on: | |
push: | |
branches: | |
- main | |
- test | |
- developer | |
- sso-spi | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- main | |
- test | |
jobs: | |
common-sso: | |
name: common-sso-ci | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./auth | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: azure/setup-helm@v3 | |
with: | |
version: 'latest ' # default is latest (stable) | |
token: ${{ secrets.GITHUB_TOKEN }} # only needed if version is 'latest' | |
id: install | |
# Release | |
- name: Changelog | |
id: changelog | |
uses: scottbrenner/generate-changelog-action@master | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
REPO: ${{ github.repository }} | |
# GitHub Release | |
- name: Create GitHub release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
files: | | |
LICENSE.txt | |
*.jar | |
# Docker | |
- name: Login to Artifactory or Openshift registry | |
uses: docker/login-action@v1 | |
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/sso-spi' || startsWith(github.ref, 'refs/tags/') | |
with: | |
registry: image-registry.apps.gold.devops.gov.bc.ca | |
username: unused | |
password: ${{ secrets.OC_PASSWORD }} | |
- name: Login to Red Hat Image registry | |
uses: docker/login-action@v1 | |
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/sso-spi' || startsWith(github.ref, 'refs/tags/') | |
with: | |
registry: registry.redhat.io | |
username: 13974471|bcgov | |
password: ${{ secrets.REDHAT_PASSWORD }} | |
- name: Extract metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/sso-spi' || startsWith(github.ref, 'refs/tags/') | |
with: | |
images: | | |
image-registry.apps.gold.devops.gov.bc.ca/e27db1-tools/common-sso | |
- name: Build and Push to registries | |
id: publish | |
uses: docker/build-push-action@v2 | |
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/sso-spi' || startsWith(github.ref, 'refs/tags/') | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
context: ./auth | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |