add autobuild repository release workflow - WIP !!!!!! #1
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: Docker automatic build and publish on repository release | ||
on: | ||
push: | ||
tags: [ 'v*.*.*' ] | ||
env: | ||
REGISTRY: ghcr.io | ||
jobs: | ||
build-and-push-base-ops: | ||
runs-on: ubuntu-latest | ||
name: Build and push vre-base-ops image | ||
strategy: | ||
matrix: | ||
context: [ | ||
'base-ops' | ||
] | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Docker Checkout | ||
uses: actions/checkout@v3 | ||
# TODO: probably do here the git checkout and the set of the version as a global VAR | ||
- name: Log in to the GH Container Registry | ||
id: login | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract metadata for ${{ matrix.environments }} | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
flavor: | | ||
latest=true | ||
tags: | | ||
type=sha | ||
# TODO: custome image tag so that it can be done a: tag_describe=$(git describe --tags | sed 's/-g/-/g') | ||
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.environments }} | ||
- name: Build and push ${{ matrix.environments }} | ||
id: build | ||
uses: docker/[email protected] | ||
with: | ||
context: ./${{ matrix.environments }} | ||
file: ./${{ matrix.environments }}/Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
BUILD_DATE=$(date +'%Y-%m-%dT%H:%M:%SZ') | ||
#TODO implement to thing below ! | ||
TAG=$(git describe --tags | sed 's/-g/-/g') | ||
build-and-push-container: | ||
runs-on: ubuntu-latest | ||
name: Build and push vre operation images | ||
strategy: | ||
matrix: | ||
context: [ | ||
'iam-reana-sync', | ||
'iam-rucio-sync', | ||
'rucio-client', | ||
'rucio-noise', | ||
] | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Docker Checkout | ||
uses: actions/checkout@v3 | ||
- name: Log in to the GH Container Registry | ||
id: login | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract metadata for ${{ matrix.environments }} | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
flavor: | | ||
latest=true | ||
tags: | | ||
type=sha | ||
# TODO: custome image tag so that it can be done a: tag_describe=$(git describe --tags | sed 's/-g/-/g') | ||
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.environments }} | ||
- name: Build and push ${{ matrix.environments }} | ||
id: build | ||
uses: docker/[email protected] | ||
with: | ||
context: ./${{ matrix.environments }} | ||
file: ./${{ matrix.environments }}/Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
BUILD_DATE=$(date +'%Y-%m-%dT%H:%M:%SZ') | ||
#TODO implement to thing below ! | ||
TAG=$(git describe --tags | sed 's/-g/-/g') | ||