Devnet Container Build #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Devnet Container Build | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Docker tag for the images' | |
required: false | |
default: 'latest' | |
variant: | |
description: 'Devnet variant' | |
required: false | |
default: 'container-default' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Nix | |
uses: cachix/install-nix-action@v16 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Setup SSH config | |
run: | | |
mkdir -p ~/.ssh && chmod 700 ~/.ssh | |
echo "${{ secrets.REMOTE_NIX_BUILDER_SSH }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa | |
cat <<EOF > ~/.ssh/config | |
Host nixremotebuilderamd64 | |
HostName ${{ secrets.REMOTE_NIX_BUILDER_HOST_AMD64 }} | |
User root | |
IdentityFile ~/.ssh/id_rsa | |
IdentitiesOnly yes | |
IdentityAgent none | |
Host nixremotebuilderarm64 | |
HostName ${{ secrets.REMOTE_NIX_BUILDER_HOST_ARM64 }} | |
User root | |
IdentityFile ~/.ssh/id_rsa | |
IdentitiesOnly yes | |
IdentityAgent none | |
EOF | |
- name: Add remote host keys to known_hosts | |
run: | | |
ssh-keyscan -H ${{ secrets.REMOTE_NIX_BUILDER_HOST_AMD64 }} >> ~/.ssh/known_hosts | |
ssh-keyscan -H ${{ secrets.REMOTE_NIX_BUILDER_HOST_ARM64 }} >> ~/.ssh/known_hosts | |
- name: Start SSH agent and add key | |
run: | | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_rsa | |
- name: Log in to Docker Hub | |
run: echo "${{ secrets.DOCKERHUB_PAT }}" | docker login -u "${{ secrets.DOCKERHUB_USER }}" --password-stdin | |
- name: Nix build | |
run: ./.github/workflows/build_and_load_docker_images.sh | |
env: | |
TAG: ${{ github.event.inputs.tag }} | |
VARIANT: ${{ github.event.inputs.variant }} |