diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c52acefcb6f..cc83622f942 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,21 +197,6 @@ jobs: - run: exec bash -c "nix-channel --add https://releases.nixos.org/nixos/unstable/nixos-23.05pre466020.60c1d71f2ba nixpkgs" - run: exec bash -c "nix-channel --update && nix-env -iA nixpkgs.hello && hello" - docker_push_image: - name: Push docker image to DockerHub and GHCR - needs: [flake_regressions, installer_test] - if: github.event_name == 'push' && github.ref_name == 'master' - uses: ./.github/workflows/docker-push.yml - with: - ref: ${{ github.sha }} - is_master: true - permissions: - contents: read - packages: write - secrets: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - flake_regressions: needs: tests runs-on: ubuntu-24.04 diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml deleted file mode 100644 index c4ccd1fe0d0..00000000000 --- a/.github/workflows/docker-push.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: "Push Docker Image" - -on: - workflow_call: - inputs: - ref: - description: "Git ref to build the docker image from" - required: true - type: string - is_master: - description: "Whether run from master branch" - required: true - type: boolean - secrets: - DOCKERHUB_USERNAME: - required: true - DOCKERHUB_TOKEN: - required: true - -permissions: {} - -jobs: - # Steps to test CI automation in your own fork. - # 1. Sign-up for https://hub.docker.com/ - # 2. Store your dockerhub username as DOCKERHUB_USERNAME in "Repository secrets" of your fork repository settings (https://github.com/$githubuser/nix/settings/secrets/actions) - # 3. Create an access token in https://hub.docker.com/settings/security and store it as DOCKERHUB_TOKEN in "Repository secrets" of your fork - check_secrets: - permissions: - contents: none - name: Check presence of secrets - runs-on: ubuntu-24.04 - outputs: - docker: ${{ steps.secret.outputs.docker }} - steps: - - name: Check for DockerHub secrets - id: secret - env: - _DOCKER_SECRETS: ${{ secrets.DOCKERHUB_USERNAME }}${{ secrets.DOCKERHUB_TOKEN }} - run: | - echo "docker=${{ env._DOCKER_SECRETS != '' }}" >> $GITHUB_OUTPUT - - push: - name: Push docker image to DockerHub and GHCR - needs: [check_secrets] - permissions: - contents: read - packages: write - if: needs.check_secrets.outputs.docker == 'true' - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - fetch-depth: 0 - ref: ${{ inputs.ref }} - - uses: ./.github/actions/install-nix-action - with: - dogfood: false - extra_nix_config: | - experimental-features = flakes nix-command - - run: echo NIX_VERSION="$(nix eval .\#nix.version | tr -d \")" >> $GITHUB_ENV - - run: nix build .#dockerImage -L - - run: docker load -i ./result/image.tar.gz - # We'll deploy the newly built image to both Docker Hub and Github Container Registry. - # - # Push to Docker Hub first - - name: Login to Docker Hub - uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Push to Docker Hub - env: - IS_MASTER: ${{ inputs.is_master }} - DOCKERHUB_REPO: ${{ secrets.DOCKERHUB_USERNAME }}/nix - run: | - docker tag nix:$NIX_VERSION $DOCKERHUB_REPO:$NIX_VERSION - docker push $DOCKERHUB_REPO:$NIX_VERSION - if [ "$IS_MASTER" = "true" ]; then - docker tag nix:$NIX_VERSION $DOCKERHUB_REPO:master - docker push $DOCKERHUB_REPO:master - fi - # Push to GitHub Container Registry as well - - name: Login to GitHub Container Registry - uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Push to GHCR - env: - IS_MASTER: ${{ inputs.is_master }} - run: | - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/nix - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - docker tag nix:$NIX_VERSION $IMAGE_ID:$NIX_VERSION - docker push $IMAGE_ID:$NIX_VERSION - if [ "$IS_MASTER" = "true" ]; then - docker tag nix:$NIX_VERSION $IMAGE_ID:master - docker push $IMAGE_ID:master - fi