From 080637739204731c17d240a2cf4ac9a9a20bbcdf Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Sat, 4 Nov 2023 23:25:08 +0100 Subject: [PATCH] finalize the docker tag and push --- .docker/Dockerfile | 4 +-- .github/workflows/docker.yml | 58 ++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 0262c8ee4..6555ec3fa 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,5 +1,5 @@ -#FROM aiidateam/aiida-core-with-services:edge -FROM aiidateam/aiida-core-with-services:newly-baked +#FROM ghcr.io/aiidateam/aiida-core-with-services:edge +FROM ghcr.io/aiidateam/aiida-core-with-services:pr-6170 USER root diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 606189add..379fb7fa3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -52,38 +52,30 @@ jobs: - name: Run tests ✅ run: TAG=newly-baked python -m pytest -s tests - #- name: Docker meta 📝 - # id: meta - # uses: docker/metadata-action@v4 - # env: ${{ fromJson(steps.build_vars.outputs.vars) }} - # with: - # images: | - # name=${{ inputs.registry }}/${{ env.OWNER }}/${{ matrix.image }} - # tags: | - # type=edge,enable={{is_default_branch}} - # type=sha,enable=${{ github.ref_type != 'tag' }} - # type=ref,event=pr - # type=match,pattern=v(\d+\.\d+.\d+),group=1 - # type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} - # type=raw,value=python-${{ env.PYTHON_VERSION }},enable=${{ startsWith(github.ref, 'refs/tags/v') }} - # type=raw,value=postgresql-${{ env.PGSQL_VERSION }},enable=${{ startsWith(github.ref, 'refs/tags/v') }} - - #- name: Login to Container Registry 🔑 - # uses: docker/login-action@v2 - # with: - # registry: ${{ inputs.registry }} - # username: ${{ secrets.REGISTRY_USERNAME }} - # password: ${{ secrets.REGISTRY_TOKEN }} + - name: Docker meta 📝 + id: meta + uses: docker/metadata-action@v4 + with: + images: | + name=ghcr.io/aiidateam/aiida-quantumespresso + tags: | + type=edge,enable={{is_default_branch}} + type=sha,enable=${{ github.ref_type != 'tag' }} + type=ref,event=pr + type=match,pattern=v(\d+\.\d+.\d+),group=1 + type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} - #- name: Set tags for image and push 🏷️📤💾 - # run: | - # declare -a arr=(${{ steps.meta.outputs.tags }}) - # for tag in "${arr[@]}"; do - # arch_tag=$(echo ${tag} | sed "s/:/:${{ inputs.architecture }}-/") - # docker tag ${{ env.OWNER }}/${{ matrix.image }}:newly-baked ${arch_tag} - # docker push ${arch_tag} + - name: Login to Container Registry 🔑 + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - # # write tag to file - # mkdir -p /tmp/aiida-core - # echo ${arch_tag} >> /tmp/aiida-core/${{ matrix.image }}-${{ inputs.architecture }}-tags.txt - # done + - name: Set tags for image and push 🏷️📤💾 + run: | + declare -a arr=(${{ steps.meta.outputs.tags }}) + for tag in "${arr[@]}"; do + docker tag aiidateam/aiida-quantumespresso:newly-baked ${tag} + docker push ${tag} + done