Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run a command in host before entering docker container in github ci

Im trying to install a package on the host system i.e (ubuntu-latest) before entering the docker container (arch linux)

I tried a lot of syntax but Im getting it wrong

on: [push]
jobs:
  update-aur:
    runs-on: ubuntu-latest
    steps:
      - run : sudo apt-get install runc
    container: archlinux
    steps:
      - run: |
          pacman --noconfirm -Syu 
          pacman --noconfirm -S base-devel 

this gives an error of steps is already defined

like image 329
sonu ishaq Avatar asked Nov 15 '25 06:11

sonu ishaq


1 Answers

If the running machine configuration is important for the build, try using self-hosted runner.

  1. You can create VM in some of the cloud providers (ex. AWS, Azure, etc.) and register it with GitHub-CI.
  2. Install the GitHub-CI service
  3. Install all the utilities you need
  4. Register the runner to the repository
  5. Change the build script for run-on to point to the self-hoster runner

You can find more information in the GitHub-CI Docs

like image 64
jordanvrtanoski Avatar answered Nov 17 '25 19:11

jordanvrtanoski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!