v0.4.23 #43
Workflow file for this run
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: Release | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: ghcr.io | |
# github.repository as <account>/<repo> | |
IMAGE_NAME_GQL: ${{ github.repository }}-gql | |
IMAGE_NAME_UI: ${{ github.repository }}-ui | |
jobs: | |
build-ui: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
env: | |
ARTIFACT_DIR: ./release | |
HELM_PACKAGE_DIR: helm | |
HELM_REPO_CODE_PATH: helm-charts-ui | |
defaults: | |
run: | |
working-directory: ./react-ui | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install | |
run: yarn | |
- name: Test | |
run: yarn run test:ci | |
- name: Set release version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | |
# Login against a Docker registry except on PR | |
# https://github.com/docker/login-action | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build images | |
run: docker build -f ./Dockerfile -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_UI }}:${{ env.RELEASE_VERSION }} . | |
- name: Push images | |
run: docker image push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_UI }}:${{ env.RELEASE_VERSION }} | |
- name: Package Helm chart | |
if: ${{ env.LATEST_RELEASE }} == "true" | |
env: | |
HELM_CHARTS_DIR: helm/atlas-application | |
run: | | |
sed -i "/ tag:/c\ tag: \"${{ env.RELEASE_VERSION }}\"" ${{ env.HELM_CHARTS_DIR }}/values.yaml | |
mkdir -p ${{ env.ARTIFACT_DIR }}/${{ env.HELM_PACKAGE_DIR }} | |
helm package ${{ env.HELM_CHARTS_DIR }} --app-version ${{ env.RELEASE_VERSION }} --version ${{ env.RELEASE_VERSION }} --destination ${{ env.ARTIFACT_DIR }}/${{ env.HELM_PACKAGE_DIR }} | |
- name: Checkout Helm Charts Repo | |
uses: actions/checkout@v2 | |
env: | |
HELM_REPO: osstotalsoft/helm-charts | |
with: | |
repository: ${{ env.HELM_REPO }} | |
ref: refs/heads/main | |
token: ${{ secrets.BOT_TOKEN }} | |
path: ${{ env.HELM_REPO_CODE_PATH }} | |
- name: Upload helm charts to Helm Repo | |
env: | |
HELM_REPO: https://osstotalsoft.github.io/helm-charts/ | |
run: | | |
cd ${{ env.ARTIFACT_DIR }}/${{ env.HELM_PACKAGE_DIR }} | |
cp -r * $GITHUB_WORKSPACE/${{ env.HELM_REPO_CODE_PATH }} | |
cd $GITHUB_WORKSPACE/${{ env.HELM_REPO_CODE_PATH }} | |
helm repo index --url ${{ env.HELM_REPO }} --merge index.yaml . | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions" | |
git add --all | |
git commit -m "Atlas release UI - ${{ env.RELEASE_VERSION }}" | |
git push | |
build-gql: | |
needs: build-ui | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
env: | |
ARTIFACT_DIR: ./release | |
HELM_PACKAGE_DIR: helm | |
HELM_REPO_CODE_PATH: helm-charts-gql | |
defaults: | |
run: | |
working-directory: ./gql-bff | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install | |
run: yarn | |
- name: Test | |
run: yarn jest | |
- name: Set release version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | |
# Login against a Docker registry except on PR | |
# https://github.com/docker/login-action | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build images | |
run: docker build -f ./Dockerfile -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_GQL }}:${{ env.RELEASE_VERSION }} . | |
- name: Push images | |
run: docker image push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_GQL }}:${{ env.RELEASE_VERSION }} | |
- name: Package Helm chart | |
if: ${{ env.LATEST_RELEASE }} == "true" | |
env: | |
HELM_CHARTS_DIR: helm/atlas-gql-mesh | |
run: | | |
sed -i "/ tag:/c\ tag: \"${{ env.RELEASE_VERSION }}\"" ${{ env.HELM_CHARTS_DIR }}/values.yaml | |
mkdir -p ${{ env.ARTIFACT_DIR }}/${{ env.HELM_PACKAGE_DIR }} | |
helm package ${{ env.HELM_CHARTS_DIR }} --app-version ${{ env.RELEASE_VERSION }} --version ${{ env.RELEASE_VERSION }} --destination ${{ env.ARTIFACT_DIR }}/${{ env.HELM_PACKAGE_DIR }} | |
- name: Checkout Helm Charts Repo | |
uses: actions/checkout@v2 | |
env: | |
HELM_REPO: osstotalsoft/helm-charts | |
with: | |
repository: ${{ env.HELM_REPO }} | |
ref: refs/heads/main | |
token: ${{ secrets.BOT_TOKEN }} | |
path: ${{ env.HELM_REPO_CODE_PATH }} | |
- name: Upload helm charts to Helm Repo | |
env: | |
HELM_REPO: https://osstotalsoft.github.io/helm-charts/ | |
run: | | |
cd ${{ env.ARTIFACT_DIR }}/${{ env.HELM_PACKAGE_DIR }} | |
cp -r * $GITHUB_WORKSPACE/${{ env.HELM_REPO_CODE_PATH }} | |
cd $GITHUB_WORKSPACE/${{ env.HELM_REPO_CODE_PATH }} | |
helm repo index --url ${{ env.HELM_REPO }} --merge index.yaml . | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions" | |
git add --all | |
git commit -m "Atlas release GQL - ${{ env.RELEASE_VERSION }}" | |
git push |