-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c360e7
commit 474f104
Showing
3 changed files
with
74 additions
and
1 deletion.
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
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
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,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 . |