Skip to content

Commit

Permalink
Update publish
Browse files Browse the repository at this point in the history
Signed-off-by: Wade Barnes <wade@neoterictech.ca>
  • Loading branch information
WadeBarnes committed Jan 12, 2023
1 parent b30568e commit 377218e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 53 deletions.
48 changes: 20 additions & 28 deletions .github/workflows/publish-indy.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
name: Publish ACA-Py (Indy)
name: Publish ACA-Py Image (Indy)
run-name: Publish ACA-Py ${{ inputs.tag || github.event.release.tag_name }} Image (Indy ${{ inputs.indy_version }})
on:
release:
types: [released]

workflow_dispatch:
inputs:
indy_version:
description: 'Indy SDK Version'
required: false
required: true
default: 1.16.0
type: string
tag:
description: 'Image tag'
required: true
type: string
version:
description: "Version label in image"
required: true
type: string

env:
INDY_VERSION: 1.16.0
INDY_VERSION: ${{ inputs.indy_version || 1.16.0}}

jobs:
publish-image:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.6', '3.9']

name: Publish (Indy)
name: Publish ACA-Py Image (Indy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Gather image info
id: info
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "::set-output name=repo-owner::${GITHUB_REPOSITORY_OWNER,,}"
echo "repo-owner=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_OUTPUT
# echo "${GITHUB_CONTEXT}"
- name: Cache Docker layers
uses: actions/cache@v3
Expand All @@ -46,46 +48,36 @@ jobs:
${{ runner.os }}-buildx-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Log in to the GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Image Metadata (manual)
if: github.event_name == 'workflow_dispatch'
id: dispatch-meta
uses: docker/metadata-action@v4.1.1
with:
images: |
ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python
tags: |
type=raw,value=py${{ matrix.python-version }}-indy-${{ inputs.tag }}
- name: Setup Image Metadata (release)
if: github.event_name == 'release'
- name: Setup Image Metadata
id: meta
uses: docker/metadata-action@v4.1.1
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python
tags: |
type=semver,pattern=py${{ matrix.python-version }}-indy-{{ inputs.indy_version || env.INDY_VERSION }}-{{version}}
type=raw,value=py${{ matrix.python-version }}-indy-${{ env.INDY_VERSION }}-${{ inputs.tag || github.event.release.tag_name }}
- name: Build and Push Image to ghcr.io
uses: docker/build-push-action@v3
with:
push: true
context: .
file: docker/Dockerfile.indy
tags: ${{ steps.dispatch-meta.outputs.tags || steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: main
build-args: |
python_version=${{ matrix.python-version }}
indy_version=${{ inputs.indy_version || env.INDY_VERSION }}
indy_version=${{ env.INDY_VERSION }}
acapy_version=${{ inputs.version || github.event.release.tag_name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
Expand Down
41 changes: 16 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
name: Publish ACA-Py
name: Publish ACA-Py Image
run-name: Publish ACA-Py ${{ inputs.tag || github.event.release.tag_name }} Image
on:
release:
types: [released]

workflow_dispatch:
inputs:
tag:
description: 'Image tag'
required: true
type: string
version:
description: "Version label in image"
required: true
type: string

jobs:
publish-image:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.6', '3.9']

name: Publish
name: Publish ACA-Py Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Gather image info
id: info
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "::set-output name=repo-owner::${GITHUB_REPOSITORY_OWNER,,}"
echo "repo-owner=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_OUTPUT
# echo "${GITHUB_CONTEXT}"
- name: Cache Docker layers
uses: actions/cache@v3
Expand All @@ -39,43 +40,33 @@ jobs:
${{ runner.os }}-buildx-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Log in to the GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Image Metadata (manual)
if: github.event_name == 'workflow_dispatch'
id: dispatch-meta
uses: docker/metadata-action@v4.1.1
with:
images: |
ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python
tags: |
type=raw,value=py${{ matrix.python-version }}-${{ inputs.tag }}
- name: Setup Image Metadata (release)
if: github.event_name == 'release'
- name: Setup Image Metadata
id: meta
uses: docker/metadata-action@v4.1.1
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python
tags: |
type=semver,pattern=py${{ matrix.python-version }}-{{version}}
type=raw,value=py${{ matrix.python-version }}-${{ inputs.tag || github.event.release.tag_name }}
- name: Build and Push Image to ghcr.io
uses: docker/build-push-action@v3
with:
push: true
context: .
file: docker/Dockerfile
tags: ${{ steps.dispatch-meta.outputs.tags || steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: main
build-args: |
python_version=${{ matrix.python-version }}
acapy_version=${{ inputs.version || github.event.release.tag_name }}
Expand Down

0 comments on commit 377218e

Please sign in to comment.