From 273684acdf2e9d53dbb3bba8107afd7ae64dcfb0 Mon Sep 17 00:00:00 2001 From: Chris Rosenthal Date: Mon, 1 Jul 2024 14:19:12 -0700 Subject: [PATCH] need to build image on latest Dockerfile before running tests --- .github/workflows/tests.yml | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4f8b930..e22f93f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,16 +1,36 @@ name: Run deenurp tests on deenurp image -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: push jobs: - build: + push_to_registry: + environment: docker_build + runs-on: ubuntu-latest + steps: + - + name: Set env + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + push: true + tags: | + ghcr.io/fhcrc/deenurp:${{ env.sha_short }} + test: runs-on: ubuntu-latest container: - image: ghcr.io/fhcrc/deenurp:latest + image: ghcr.io/fhcrc/deenurp:${{ env.sha_short }} steps: - uses: actions/checkout@v3 - run: |