Skip to content

Commit

Permalink
ci: fix docker IMG hash
Browse files Browse the repository at this point in the history
  • Loading branch information
js2264 committed Jan 22, 2024
1 parent 1aad2ca commit 3ddd043
Showing 1 changed file with 51 additions and 51 deletions.
102 changes: 51 additions & 51 deletions .github/workflows/biocbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,68 +19,68 @@ jobs:
- name: 🧾 Checkout repository
uses: actions/checkout@v3

- name: ⏳ Collect Workflow Telemetry
uses: runforesight/workflow-telemetry-action@v1
# - name: ⏳ Collect Workflow Telemetry
# uses: runforesight/workflow-telemetry-action@v1

- name: 🐳 Set up QEMU
uses: docker/setup-qemu-action@v3
- name: 🐳 Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# - name: 🐳 Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: 🐳 Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

- name: πŸ“ Get book info
id: info
env:
OWNER: ${{ github.repository_owner }}
run: |
Pkgname=$(grep -m1 -E '^Package: +' DESCRIPTION | sed -E 's/.*: +//')
echo Pkgname=${Pkgname} >> "${GITHUB_ENV}"
pkgname=${Pkgname,,}
echo pkgname=${pkgname} >> "${GITHUB_ENV}"
owner=${OWNER,,}
echo owner=${owner} >> "${GITHUB_ENV}"
echo pkgversion=$(grep -m1 -E '^Version: +' DESCRIPTION | sed -E 's/.*: +//') >> "${GITHUB_ENV}"
# - name: πŸ“ Get book info
# id: info
# env:
# OWNER: ${{ github.repository_owner }}
# run: |
# Pkgname=$(grep -m1 -E '^Package: +' DESCRIPTION | sed -E 's/.*: +//')
# echo Pkgname=${Pkgname} >> "${GITHUB_ENV}"
# pkgname=${Pkgname,,}
# echo pkgname=${pkgname} >> "${GITHUB_ENV}"
# owner=${OWNER,,}
# echo owner=${owner} >> "${GITHUB_ENV}"
# echo pkgversion=$(grep -m1 -E '^Version: +' DESCRIPTION | sed -E 's/.*: +//') >> "${GITHUB_ENV}"

- name: πŸ” Log in to the Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: πŸ” Log in to the Github Container registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ env.owner }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: 🏷 Get metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ env.owner }}/${{ env.pkgname }}
tags: |
${{ github.ref_name }}
${{ env.pkgversion }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'devel') }}
# - name: 🏷 Get metadata for Docker
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: ghcr.io/${{ env.owner }}/${{ env.pkgname }}
# tags: |
# ${{ github.ref_name }}
# ${{ env.pkgversion }}
# type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'devel') }}

- name: πŸ“¦ Install, build and check package in local Docker image
id: docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
BIOC_VERSION=${{ github.ref_name }}
# - name: πŸ“¦ Install, build and check package in local Docker image
# id: docker
# uses: docker/build-push-action@v5
# with:
# context: .
# load: true
# tags: ${{ steps.meta.outputs.tags }}
# build-args: |
# BIOC_VERSION=${{ github.ref_name }}

- name: πŸš€ Push local Docker image to ghcr.io
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
BIOC_VERSION=${{ github.ref_name }}
# - name: πŸš€ Push local Docker image to ghcr.io
# uses: docker/build-push-action@v5
# with:
# context: .
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# build-args: |
# BIOC_VERSION=${{ github.ref_name }}

- name: πŸ“š Recover pkg artifacts generated during build in local Docker container (pkg bundle and book)
env:
IMG: ${{ steps.docker.outputs.ImageID }}
run: |
SHA=$(docker container create ${{ env.IMG }})
SHA=$(docker container create docker pull ghcr.io/js2264/ohca:latest)
docker container cp ${SHA}:/${{ env.Pkgname }}_${{ env.pkgversion }}.tar.gz .
tar --extract --gzip --file ${{ env.Pkgname }}_${{ env.pkgversion }}.tar.gz
echo bundle_path=${{ env.Pkgname }}_${{ env.pkgversion }}.tar.gz >> "${GITHUB_ENV}"
Expand Down

0 comments on commit 3ddd043

Please sign in to comment.