Skip to content

Commit

Permalink
Add redis-proxy to build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenchristian1telus committed Dec 17, 2024
1 parent 0c360e7 commit 474f104
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/archive/build-push-all-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
- name: 🛠️ Build Redis Proxy
run: |
cd ./config/redis
docker buildx build --build-arg GOLANG_FROM_IMAGE=${{ secrets.ARTIFACTORY_URL }}/${{ GOLANG_IMAGE }} --build-arg UBUNTU_FROM_IMAGE=${{ secrets.ARTIFACTORY_URL }}/${{ UBUNTU_IMAGE }} --tag ${{ secrets.ARTIFACTORY_URL }}/${{ env.REDIS_PROXY_NAME }}:${{ env.OPENSHIFT_DEPLOY_PROJECT }}-${{ github.ref_name }} --output=type=image,push=true --push -f ./GoLang.Dockerfile .
docker buildx build --build-arg GOLANG_FROM_IMAGE=${{ secrets.ARTIFACTORY_URL }}/${{ env.GOLANG_IMAGE }} --build-arg UBUNTU_FROM_IMAGE=${{ secrets.ARTIFACTORY_URL }}/${{ env.UBUNTU_IMAGE }} --tag ${{ secrets.ARTIFACTORY_URL }}/${{ env.REDIS_PROXY_NAME }}:${{ env.OPENSHIFT_DEPLOY_PROJECT }}-${{ github.ref_name }} --output=type=image,push=true --push -f ./GoLang.Dockerfile .
- name: 🛠️ Build Moodle Image
run: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ jobs:
uses: ./.github/workflows/moodle.yml
secrets: inherit

redis-proxy:
name: 🔨 Redis Proxy
needs: [checkEnv]
if: needs.checkEnv.outputs.SKIP_BUILDS == 'NO'
uses: ./.github/workflows/redis-proxy.yml
secrets: inherit

call-cleanup-workflow:
name: 🧹️ Clean-up
uses: ./.github/workflows/cleanup.yml
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/redis-proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Redis

concurrency:
group: cron-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

env:
APP: moodle
USER: ${{ github.actor }}

on:
workflow_call:

jobs:
build-images:
name: '🐸 Build to JFrog'
runs-on: ubuntu-22.04
if: (github.ref_name == 'dev' || github.ref_name == 'test' || github.ref_name == 'prod')
steps:
# Checkout the PR branch
- name: 📤 Checkout Target Branch
uses: actions/checkout@v4
with:
ref: dev
sparse-checkout: |
config/redis
example.env
example.versions.env
openshift/scripts
# Login to Artifactory
- name: 🔑 Login to Artifactory
uses: docker/login-action@v3
with:
registry: ${{ secrets.ARTIFACTORY_URL }}
username: ${{ secrets.ARTIFACTORY_USER }}
password: ${{ secrets.ARTIFACTORY_PASSWORD }}

- name: Setup Env Vars
id: dotenv
uses: falti/dotenv-action@v1
with:
path: example.env
export-variables: true
keys-case: upper

- name: Setup Versions Env Vars
id: dotenv_versions
uses: falti/dotenv-action@v1
with:
path: example.versions.env
export-variables: true
keys-case: upper

- name: 🛠️ Pull Base Images
run: |
docker pull ${{ env.GOLANG_IMAGE }}
docker pull ${{ env.UBUNTU_IMAGE }}
- name: 🐸 Build and Push to JFrog
run: |
docker tag ${{ env.GOLANG_IMAGE }} ${{ secrets.ARTIFACTORY_URL }}/${{ env.GOLANG_IMAGE }}
docker push ${{ secrets.ARTIFACTORY_URL }}/${{ env.GOLANG_IMAGE }}
docker tag ${{ env.UBUNTU_IMAGE }} ${{ secrets.ARTIFACTORY_URL }}/${{ env.UBUNTU_IMAGE }}
docker push ${{ secrets.ARTIFACTORY_URL }}/${{ env.UBUNTU_IMAGE }}
docker buildx build --build-arg GOLANG_FROM_IMAGE=${{ secrets.ARTIFACTORY_URL }}/${{ env.GOLANG_IMAGE }} --build-arg UBUNTU_FROM_IMAGE=${{ secrets.ARTIFACTORY_URL }}/${{ env.UBUNTU_IMAGE }} --tag ${{ secrets.ARTIFACTORY_URL }}/${{ env.REDIS_PROXY_NAME }}:${{ env.OPENSHIFT_DEPLOY_PROJECT }}-${{ github.ref_name }} --output=type=image,push=true --push -f ./GoLang.Dockerfile .

0 comments on commit 474f104

Please sign in to comment.