Commit ab90dde6 authored by TomKellyGenetics's avatar TomKellyGenetics
Browse files

test calling GitHub actions with containers

parent af820584
Loading
Loading
Loading
Loading
+54 −0
Original line number Diff line number Diff line
name: CI to Docker hub runners
on: push
jobs:
  test:
    runs-on: ubuntu-20.04
    steps:
      -
        name: Login to DockerHub
        uses: docker/login-action@v1 
        with:
          username: ${{ secrets.DOCKER_HUB_USERNAME }}
          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

  build:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - uses: docker/setup-buildx-action@v1
    - uses: docker/login-action@v1
      with:
        username: ${{ secrets.DOCKER_HUB_USERNAME }}
        password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
        registry: ${{ env.REGISTRY }}

    - name: Build and push
      uses: docker/build-push-action@v2
      with:
        context: ./
        file: ./Dockerfile
        tags: ${{ secrets.DOCKER_HUB_USERNAME }}/universc:latest
        push: false

  push:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - uses: docker/setup-buildx-action@v1
    - uses: docker/login-action@v1
      with:
        username: ${{ secrets.DOCKER_HUB_USERNAME }}
        password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
        registry: ${{ env.REGISTRY }}

    - name: Build and push
      uses: docker/build-push-action@v2
      with:
        context: ./
        file: ./Dockerfile
        tags: ${{ secrets.DOCKER_HUB_USERNAME }}/universc:latest
        push: false
    - name: Hello world 
      run: docker run -it -d --name builder -v $GITHUB_WORKSPACE:/workspace -w ${{ secrets.DOCKER_HUB_USERNAME }}/universc:latest echo "hello world"
    - name: Diagnostics
      run: docker run -it -d --name builder -v $GITHUB_WORKSPACE:/workspace -w ${{ secrets.DOCKER_HUB_USERNAME }}/universc:latest pwd;ls
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@ jobs:
      - uses: actions/checkout@v2
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          username: ${{ secrets.DOCKER_HUB_USERNAME }}
          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
      - name: Build the stack
        run: docker-compose up -d
      - name: Status
+4 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ jobs:
      - uses: actions/checkout@v2
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          username: ${{ secrets.DOCKER_HUB_USERNAME }}
          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
      - name: What OS is running
        run: uname -a
      - name: Where am i
@@ -39,6 +41,8 @@ jobs:
      - uses: actions/checkout@v2
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          username: ${{ secrets.DOCKER_HUB_USERNAME }}
          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
      - name: What OS is running
        run: uname -a
      - name: Where am i