fix: use matterlabsrobot docker namespace

Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
Harald Hoyer 2024-02-14 16:10:51 +01:00
parent 743ecc67b5
commit b59db0f996
Signed by: harald
GPG key ID: F519A1143B3FBE32

View file

@ -39,11 +39,13 @@ jobs:
with: with:
extra_nix_config: | extra_nix_config: |
access-tokens = github.com=${{ github.token }} access-tokens = github.com=${{ github.token }}
- uses: cachix/cachix-action@v14 # Cache any artifacts that aren't already cached at https://cache.nixos.org
continue-on-error: true - name: Enable magic Nix cache
with: uses: DeterminateSystems/magic-nix-cache-action@main
name: nixsgx - name: Use nixsgx cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' run: |
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use nixsgx
- name: cargo clippy - name: cargo clippy
run: nix develop -L --ignore-environment -c cargo clippy --all --locked run: nix develop -L --ignore-environment -c cargo clippy --all --locked
@ -55,32 +57,49 @@ jobs:
with: with:
extra_nix_config: | extra_nix_config: |
access-tokens = github.com=${{ github.token }} access-tokens = github.com=${{ github.token }}
- uses: cachix/cachix-action@v14
continue-on-error: true
with:
name: nixsgx
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
# Cache any artifacts that aren't already cached at https://cache.nixos.org # Cache any artifacts that aren't already cached at https://cache.nixos.org
- name: Enable magic Nix cache - name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main uses: DeterminateSystems/magic-nix-cache-action@main
- name: Use nixsgx cache
run: |
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use nixsgx
- name: nix build - name: nix build
run: nix run nixpkgs#nixci run: nix run nixpkgs#nixci
push_to_docker:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: cachix/install-nix-action@6004951b182f8860210c8d6f0d808ec5b1a33d28 # v25
with:
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
# Cache any artifacts that aren't already cached at https://cache.nixos.org
- name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Use nixsgx cache
run: |
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use nixsgx
- name: Log in to Docker Hub - name: Log in to Docker Hub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USER }} username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Load and push - name: Load and push
if: ${{ github.event_name == 'push' }}
run: | run: |
nix build -L .#container-verify-attestation nix build -L .#container-verify-attestation
export IMAGE_TAG=$(docker load < result | grep -Po 'Loaded image.*: \K.*') export IMAGE_TAG=$(docker load < result | grep -Po 'Loaded image.*: \K.*')
echo "Pushing image ${IMAGE_TAG} to Docker Hub" echo "Pushing image ${IMAGE_TAG} to Docker Hub"
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
docker push "${IMAGE_TAG}" docker push matterlabsrobot/"${IMAGE_TAG}"
docker push "${IMAGE_TAG%:*}:latest" docker push matterlabsrobot/"${IMAGE_TAG%:*}:latest"