Skip to content

.github/workflows/image-release.yaml #6

.github/workflows/image-release.yaml

.github/workflows/image-release.yaml #6

Workflow file for this run

name: Build Release Docker Images
on:
create:
tags: '*'
workflow_dispatch:
jobs:
build-images:
runs-on: ubuntu-latest
steps:
- name: Checkout Automation Code
uses: actions/checkout@v4
- name: Get Metadata
run: |
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
echo "ISO8601=$(LC_TIME=en_US.UTF-8 date "+%Y-%m-%dT%H:%M:%S%z")" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Setup Jfrog
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: ${{ secrets.ARTIFACTORY_URL }}
JF_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
- name: Login to JFrog
uses: docker/login-action@v2
with:
registry: aerospike.jfrog.io
username: ${{ secrets.ARTIFACTORY_USER }}
password: ${{ secrets.ARTIFACTORY_TOKEN }}
- name: Build and Push
uses: docker/bake-action@v4
env:
GIT_COMMIT_SHA: ${{ github.sha }}
GIT_BRANCH: golib-release-proccess
LATEST: false
TAG: ${{ github.ref_name }}
CONTEXT: ${{ github.workspace }}
PROJECT: ${{ github.event.repository.name }}
with:
workdir: ${{ github.workspace }}
files: ${{ github.workspace }}/build/docker-build/docker-bake.hcl
targets: default
- name: Promote image with version tag
env:
ARTIFACTORY_CONTAINER_DEV: ${{ vars.ARTIFACTORY_CONTAINER_DEV }}
ARTIFACTORY_CONTAINER_PROD: ${{ vars.ARTIFACTORY_CONTAINER_PROD }}
run: |
jfrog rt docker-promote aerospike-backup-service \
"$ARTIFACTORY_CONTAINER_DEV" \
"ecosystem-container-stage-local" \
--source-tag "$TAG" \
--target-tag "$TAG" \
--user "${{ secrets.ARTIFACTORY_USER }}" \
--password "${{ secrets.ARTIFACTORY_TOKEN }}" \
--url "${{ secrets.ARTIFACTORY_PROMOTE_URL }}" \
--copy
- name: Promote image with latest tag
env:
ARTIFACTORY_CONTAINER_DEV: ${{ vars.ARTIFACTORY_CONTAINER_DEV }}
ARTIFACTORY_CONTAINER_PROD: ${{ vars.ARTIFACTORY_CONTAINER_PROD }}
run: |
jfrog rt docker-promote aerospike-backup-service \
"$ARTIFACTORY_CONTAINER_DEV" \
"ecosystem-container-stage-local" \
--source-tag "${{ github.event.inputs.version }}" \
--target-tag "latest" \
--user "${{ secrets.ARTIFACTORY_USER }}" \
--password "${{ secrets.ARTIFACTORY_TOKEN }}" \
--url "${{ secrets.ARTIFACTORY_PROMOTE_URL }}" \
--copy