-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Luke Rogerson
committed
Aug 23, 2023
1 parent
1da5402
commit 49b5169
Showing
1 changed file
with
59 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,66 @@ | ||
name: build-and-test | ||
# name: build-and-test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- "*" | ||
# on: | ||
# push: | ||
# branches-ignore: | ||
# - "*" | ||
|
||
# jobs: | ||
# build: | ||
# runs-on: ubuntu-22.04 | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
|
||
# # - name: Install Dependencies and Configure Environment | ||
# # run: | | ||
# # sudo useradd -ms /bin/bash ubuntu | ||
# # sudo sh -c 'echo "ubuntu ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ubuntu' | ||
# # sudo chmod 0440 /etc/sudoers.d/ubuntu | ||
|
||
# - name: Run Script | ||
# env: | ||
# PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | ||
# ETH_ENDPOINT: ${{ secrets.ETH_ENDPOINT }} | ||
# # Set Podman env vars here as the workflow runs in a non-interactive shell | ||
# # so modifying the .bashrc file does not work | ||
# DOCKER_HOST: unix://$XDG_RUNTIME_DIR/podman/podman.sock | ||
# PODMAN_SOCKET_PATH: $XDG_RUNTIME_DIR/podman/podman.sock | ||
|
||
# run: | | ||
# # Move to home directory | ||
# cp -r $HOME/work/v3-node-setup/v3-node-setup/* $HOME | ||
# chmod +x ./setup/install.sh | ||
# ./setup/install.sh --skip-req | ||
|
||
name: Docker-in-Docker workflow | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# - name: Install Dependencies and Configure Environment | ||
# run: | | ||
# sudo useradd -ms /bin/bash ubuntu | ||
# sudo sh -c 'echo "ubuntu ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ubuntu' | ||
# sudo chmod 0440 /etc/sudoers.d/ubuntu | ||
|
||
- name: Run Script | ||
env: | ||
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | ||
ETH_ENDPOINT: ${{ secrets.ETH_ENDPOINT }} | ||
# Set Podman env vars here as the workflow runs in a non-interactive shell | ||
# so modifying the .bashrc file does not work | ||
DOCKER_HOST: unix://$XDG_RUNTIME_DIR/podman/podman.sock | ||
PODMAN_SOCKET_PATH: $XDG_RUNTIME_DIR/podman/podman.sock | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Run Docker-in-Docker | ||
run: | | ||
# Move to home directory | ||
cp -r $HOME/work/v3-node-setup/v3-node-setup/* $HOME | ||
chmod +x ./setup/install.sh | ||
./setup/install.sh --skip-req | ||
# Start docker daemon in the background | ||
sudo service docker start | ||
# Wait for the daemon to be up and running | ||
sleep 5 | ||
# Now you can run Docker commands, for example: | ||
docker info | ||
docker run hello-world | ||
- name: Clean up Docker | ||
if: always() | ||
run: sudo service docker stop |