diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7d18aa3..60274b6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -44,27 +44,23 @@ jobs: id: print run: echo ${{steps.vars.outputs.tag}} - - name: Log into Docker Hub - run: echo ${{ secrets.DOCKER_TOKEN }} | docker login --username ${{ secrets.DOCKER_USERNAME }} --password-stdin + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Pull previous images - run: | - docker pull lsstsqre/narrativelog:deps-${{steps.vars.outputs.tag}} || true - docker pull lsstsqre/narrativelog:${{steps.vars.outputs.tag}} || true - - - name: Build the dependencies Docker image - run: | - docker build --target dependencies-image \ - --cache-from=lsstsqre/narrativelog:deps-${{steps.vars.outputs.tag}} \ - --tag lsstsqre/narrativelog:deps-${{steps.vars.outputs.tag}} . - - - name: Build the runtime Docker image - run: | - docker build --target runtime-image \ - --cache-from=lsstsqre/narrativelog:${{steps.vars.outputs.tag}} \ - --tag lsstsqre/narrativelog:${{steps.vars.outputs.tag}} . + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Push Docker images - run: | - docker push lsstsqre/narrativelog:deps-${{steps.vars.outputs.tag}} - docker push lsstsqre/narrativelog:${{steps.vars.outputs.tag}} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ghcr.io/lsst-ts/narrativelog:${{ steps.vars.outputs.tag }} + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/amd64