Skip to content

Commit

Permalink
test v1.6.0 of proudust/gh-describe
Browse files Browse the repository at this point in the history
  • Loading branch information
garciagenrique committed Jan 8, 2024
1 parent e60e499 commit 011790e
Showing 1 changed file with 61 additions and 52 deletions.
113 changes: 61 additions & 52 deletions .github/workflows/docker-autobuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker automatic build and publish when changes in container dir
on:
push:
branches:
- main
- CI_short_sha
pull_request:
branches:
- main
Expand Down Expand Up @@ -55,6 +55,7 @@ jobs:
modified_containers: ${{ steps.format-output.outputs.container_list }}

build-and-push-modified-containers:
if: ${{ fromJSON(needs.build-matrix-from-changed-dirs.outputs.modified_containers) }} == []
needs: build-matrix-from-changed-dirs
runs-on: ubuntu-latest
strategy:
Expand All @@ -69,56 +70,64 @@ jobs:
- name: Docker Checkout
uses: actions/checkout@v4

- name: Format tag
id: format-tag
# - name: Format tag
# id: format-tag
# run: |
# git clone https://github.com/vre-hub/vre.git
# cd vre
# echo "describe_tag is $(git describe --tags | sed 's/-g/-/g')"
# describe_tag=$(git describe --tags | sed 's/-g/-/g')
# echo "latest_tag is $(git describe --tags --abbrev=0)"
# latest_tag=$(git describe --tags --abbrev=0)

# echo "DESCRIBE_TAG=${describe_tag}" >> $GITHUB_ENV
# echo "LATEST_TAG=${latest_tag}" >> $GITHUB_ENV

# - name: Check env output
# run: |
# echo "latest_version" is ${{ env.LATEST_TAG }}
# echo "describe_tag" is ${{ env.DESCRIBE_TAG }}

- name: Action for git describe
id: ghd
uses: proudust/[email protected]

- name: check env output
run: |
git clone https://github.com/vre-hub/vre.git
cd vre
echo "describe_tag is $(git describe --tags | sed 's/-g/-/g')"
describe_tag=$(git describe --tags | sed 's/-g/-/g')
echo "latest_tag is $(git describe --tags --abbrev=0)"
latest_tag=$(git describe --tags --abbrev=0)
echo "DESCRIBE_TAG=${describe_tag}" >> $GITHUB_ENV
echo "LATEST_TAG=${latest_tag}" >> $GITHUB_ENV
- name: Check env output
run: |
echo "latest_version" is ${{ env.LATEST_TAG }}
echo "describe_tag" is ${{ env.DESCRIBE_TAG }}
# - name: Action for git describe
# id: ghd
# uses: proudust/[email protected]

- name: Log in to the GH Container Registry
id: login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
echo "describe : ${{ steps.ghd.outputs.describe }}"
echo "tag : ${{ steps.ghd.outputs.tag }}"
echo "distance : ${{ steps.ghd.outputs.distance }}"
echo "sha : ${{ steps.ghd.outputs.sha }}"
echo "short-sha : ${{ steps.ghd.outputs.short-sha }}"
# - name: Log in to the GH Container Registry
# id: login
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for ${{ matrix.containers }}
id: metadata
uses: docker/[email protected]
with:
flavor: |
latest=true
tags: |
type=raw,value=${{ env.DESCRIBE_TAG }}
# ghcr.io/vre-hub/{vre}-{container_name}:{tag}
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }}-${{ matrix.containers }}

- name: Build and push ${{ matrix.containers }}
id: build
uses: docker/[email protected]
with:
context: containers/${{ matrix.containers }}
file: containers/${{ matrix.containers }}/Dockerfile
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: |
BUILD_DATE=$(date +'%Y-%m-%dT%H:%M:%SZ')
TAG=${{ env.LATEST_TAG }}
# - name: Extract metadata for ${{ matrix.containers }}
# id: metadata
# uses: docker/[email protected]
# with:
# flavor: |
# latest=true
# tags: |
# type=raw,value=${{ env.DESCRIBE_TAG }}
# # Expected format: ghcr.io/vre-hub/{vre}-{container_name}:{tag}
# images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }}-${{ matrix.containers }}

# - name: Build and push ${{ matrix.containers }}
# id: build
# uses: docker/[email protected]
# with:
# context: containers/${{ matrix.containers }}
# file: containers/${{ matrix.containers }}/Dockerfile
# push: true
# tags: ${{ steps.metadata.outputs.tags }}
# labels: ${{ steps.metadata.outputs.labels }}
# build-args: |
# BUILD_DATE=$(date +'%Y-%m-%dT%H:%M:%SZ')
# TAG=${{ env.LATEST_TAG }}

0 comments on commit 011790e

Please sign in to comment.