This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
Bump word-wrap from 1.2.3 to 1.2.4 #184
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: Build Docker Image | |
on: | |
push: | |
release: | |
types: [published] | |
env: | |
APP_NAME: cate-app | |
ORG_NAME: ccitools | |
REG_NAME: quay.io | |
jobs: | |
build-docker-image: | |
runs-on: ubuntu-latest | |
name: build-docker-image | |
env: | |
APP_NAME: cate-app | |
steps: | |
- name: git-checkout | |
uses: actions/checkout@v2 | |
- name: get-release-tag | |
id: release | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- name: info | |
id: info | |
run: | | |
echo "TAG: ${{ steps.release.outputs.tag }}" | |
echo "EVENT: ${{ github.event_name }}" | |
- uses: mr-smithers-excellent/docker-build-push@v5 | |
name: build-push-docker-image-latest | |
if: ${{ github.event_name == 'push' && steps.release.outputs.tag == 'master' }} | |
with: | |
image: ccitools/${{ env.APP_NAME }} | |
tags: master, latest | |
registry: quay.io | |
username: ${{ secrets.QUAY_DOCKER_REPO_USERNAME }} | |
password: ${{ secrets.QUAY_DOCKER_REPO_PASSWORD }} | |
- uses: mr-smithers-excellent/docker-build-push@v5 | |
name: build-push-docker-image | |
if: ${{ github.event_name == 'release' }} | |
with: | |
image: ccitools/${{ env.APP_NAME }} | |
tags: ${{ steps.release.outputs.tag }} | |
registry: quay.io | |
username: ${{ secrets.QUAY_DOCKER_REPO_USERNAME }} | |
password: ${{ secrets.QUAY_DOCKER_REPO_PASSWORD }} | |
update-version-cate-app: | |
env: | |
PUSH: 1 | |
runs-on: ubuntu-latest | |
needs: build-docker-image | |
name: update-version-cate-app | |
steps: | |
- name: git-checkout | |
uses: actions/checkout@v2 | |
- uses: actions/checkout@v2 | |
with: | |
repository: bc-org/k8s-configs | |
token: ${{ secrets.API_TOKEN_GITHUB }} | |
path: k8s | |
- name: get-release-tag | |
id: release | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- name: deployment-phase | |
id: deployment-phase | |
uses: bc-org/[email protected] | |
with: | |
event_name: ${{ github.event_name }} | |
tag: ${{ steps.release.outputs.tag }} | |
- name: get-hash | |
id: get-hash | |
run: | | |
HASH=$(skopeo inspect docker://${{ env.REG_NAME }}/${{ env.ORG_NAME }}/${{ env.APP_NAME }}:${{ steps.release.outputs.tag }} | jq '.Digest') | |
if [[ "$HASH" == *"sha256"* ]]; then | |
echo ::set-output name=hash::$HASH | |
else | |
echo "No hash present. Using none as hash. This will use the version tag instead for the deployment." | |
echo ::set-output name=hash::none | |
fi | |
- name: info | |
run: | | |
echo "App": ${{ env.APP_NAME }} | |
echo "Event: ${{ github.event_name }}" | |
echo "Deployment Stage: ${{ steps.deployment-phase.outputs.phase }}" | |
echo "Release Tag: ${{ steps.release.outputs.tag }}" | |
echo "Deployment Release Tag: ${{ steps.deployment-phase.outputs.tag }}" | |
echo "Deployment Digest: ${{ steps.get-hash.outputs.hash }}" | |
- name: set-version-tag-cate | |
uses: bc-org/gha-update-application-version-tags@main | |
with: | |
app: ${{ env.APP_NAME }} | |
phase: ${{ steps.deployment-phase.outputs.phase }} | |
delimiter: ' ' | |
tag: ${{ steps.deployment-phase.outputs.tag }} | |
hash: ${{ steps.get-hash.outputs.hash }} | |
working-directory: ./k8s/cate/helm | |
- name: cat-result | |
working-directory: ./k8s/cate/helm | |
run: | | |
head -n 16 values-dev.yaml | |
head -n 16 values-stage.yaml | |
head -n 16 values-prod.yaml | |
- name: Pushes to another repository | |
if: ${{ steps.deployment-phase.outputs.phase != 'ignore' }} | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source-directory: 'k8s' | |
destination-github-username: 'bc-org' | |
destination-repository-name: 'k8s-configs' | |
user-email: [email protected] | |
target-branch: main | |
commit-message: ${{ github.event.release }}. Set version to ${{ steps.release.outputs.tag }} |