Skip to content

Commit

Permalink
feat(Github-Actions): added deloyment action for base container
Browse files Browse the repository at this point in the history
  • Loading branch information
shinybrar committed Oct 24, 2023
1 parent 3446c26 commit 32df4a2
Showing 1 changed file with 45 additions and 48 deletions.
93 changes: 45 additions & 48 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,66 +30,63 @@ jobs:
release_created: ${{ steps.release-please.outputs.releases_created }}
releases: ${{ steps.release-please.outputs.releases }}
tag_name: ${{ steps.release-please.outputs.tag_name }}
build:


builder:
runs-on: ubuntu-latest
needs: releaseer
if : ${{ needs.releaseer.outputs.release_created }}
strategy:
matrix:
python-version: [3.9]
python-version: [3.9, 3.10, 3.11, 3.12]
steps:
-
-
name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 1
-
name: Fetch Release Tags
name: Create Release Metadata
id: metadata
run: |
echo "Creating Release Metadata"
echo "Release Ver: ${{ needs.releaseer.outputs.releases }}"
echo "Release Tag: ${{ needs.releaseer.outputs.tag_name }}"
# REGISTRY="images.canfar.net/"
# echo REGISTRY=${REGISTRY} >> $GITHUB_OUTPUT
# IMAGE="canfar/base"
# echo IMAGE=${IMAGE} >> $GITHUB_OUTPUT
# TAG=${{ matrix.info.tag_name }}
# echo TAG=${TAG} >> $GITHUB_OUTPUT
# echo IMAGE_LATEST=${REGISTRY}${IMAGE}:latest >> $GITHUB_OUTPUT
# echo IMAGE_TAGGED=${REGISTRY}${IMAGE}:${TAG} >> $GITHUB_OUTPUT
# -
# name: Setup Docker Buildx Environment
# if: ${{ steps.release-please.outputs.release_created }}
# id: buildx
# uses: docker/setup-buildx-action@v1
# with:
# install: true
# -
# name: Perform CANFAR Harbor Login
# if: ${{ steps.release-please.outputs.release_created }}
# uses: docker/login-action@v1
# with:
# registry: images.canfar.net
# username: ${{ secrets.HARBOR_CANFAR_USERNAME }}
# password: ${{ secrets.HARBOR_CANFAR_PASSWORD }}
# -
# name: Build & Push Production Image
# if: ${{ steps.release-please.outputs.release_created }}
# uses: docker/build-push-action@v3
# id: build-push-production
# with:
# context: .
# file: scicon/images/base/Dockerfile
# platforms: linux/amd64
# build-args:
# PYTHON_VERSION=3.9
# tags: |
# ${{ steps.metadata.outputs.IMAGE_LATEST }}
# ${{ steps.metadata.outputs.IMAGE_TAGGED }}
# push: true
# cache-from: type=gha
# cache-to: type=gha,mode=max
REGISTRY="images.canfar.net/"
echo REGISTRY=${REGISTRY} >> $GITHUB_OUTPUT
IMAGE="canfar/base"
echo IMAGE=${IMAGE} >> $GITHUB_OUTPUT
FLAVOR=${{ matrix.python-version }}
echo FLAVOR=${FLAVOR} >> $GITHUB_OUTPUT
TAG=${{ needs.releaseer.outputs.tag_name }}
echo TAG=${TAG} >> $GITHUB_OUTPUT
echo IMAGE_LATEST=${REGISTRY}${IMAGE}-{FLAVOR}:latest >> $GITHUB_OUTPUT
echo IMAGE_TAGGED=${REGISTRY}${IMAGE}-{FLAVOR}:${TAG} >> $GITHUB_OUTPUT
-
name: Setup Docker Buildx Environment
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true
-
name: Perform CANFAR Harbor Login
uses: docker/login-action@v1
with:
registry: images.canfar.net
username: ${{ secrets.HARBOR_CANFAR_USERNAME }}
password: ${{ secrets.HARBOR_CANFAR_PASSWORD }}
-
name: Build & Push Production Image
uses: docker/build-push-action@v3
id: build-push-production
with:
context: scicon/images/base
file: scicon/images/base/Dockerfile
platforms: linux/amd64
build-args:
PYTHON_VERSION=${{ matrix.python-version }}
tags: |
${{ steps.metadata.outputs.IMAGE_LATEST }}
${{ steps.metadata.outputs.IMAGE_TAGGED }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 32df4a2

Please sign in to comment.