Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Apr 17, 2024
1 parent aa675c8 commit 4072d67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build images upload them to ghcr.io
name: Build and test image and upload them to ghcr.io

env:
OWNER: ${{ github.repository_owner }}
Expand Down Expand Up @@ -51,19 +51,19 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate tags for images on ghcr.io
id: meta
id: tags_template
uses: docker/metadata-action@v4
with:
bake-target: __template__-meta
images: |
name=ghcr.io/aiidalab/__template__
name=${{ env.REGISTRY }}/aiidalab/__template__
tags: |
type=sha
type=ref,event=pr
- name: Generate docker-bake meta file.
- name: Generate docker-bake metadata file.
env:
BAKE_TEMPLATE_FILE: ${{ steps.meta.outputs.bake-file }}
BAKE_TEMPLATE_FILE: ${{ steps.tags_template.outputs.bake-file }}
run: |
.github/workflows/merge-bake-template-target.sh ${BAKE_TEMPLATE_FILE} \
| tee docker-bake-template-meta.json
Expand All @@ -82,15 +82,12 @@ jobs:
build.json
docker-bake-template-meta.json
# TODO: Maybe upload docker-bake-template-meta.json as artifact
- name: Set output variables
id: bake_metadata
run: |
echo "First step" && cat docker-bake-template-meta.json
cat docker-bake-template-meta.json \
| jq -c '.target | [to_entries[] | {"key": (.key|split("-")[:-1] | join("-")), "value": [.value.tags[]][1]}] | from_entries' \
| tee bake-meta.json
echo "Second step: bake-meta.json" && cat bake-meta.json
targets=$(echo $(cat bake-meta.json | jq -c 'keys'))
images=$(echo $(cat bake-meta.json | jq -c '. | [to_entries[] | {"key": (.key| split("-")| join("_") |ascii_upcase + "_IMAGE"), "value": .value}] | from_entries'))
echo -e "targets=$targets\nimages=$images"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ jobs:
architecture: amd64
runsOn: ubuntu-latest

# TODO: Split test from build
# TODO: Split test from build, but we'd need to
# pass outputs from build here.
#amd64-test:
# needs: amd64-build
# uses: ./.github/workflows/test.yml
# with:
# architecture: amd64
# runsOn: ubuntu-latest

# Postpone ARM build until amd64 succeeds
# but run it in parallel with amd64 tests.
# Postpone ARM build until amd64 build and tests succeeds
arm-build:
uses: ./.github/workflows/build.yml
needs: amd64-build
Expand Down

0 comments on commit 4072d67

Please sign in to comment.