diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index ade7057..d358e7a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -25,36 +25,24 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Run tests - run: | - if [ -f docker-compose.test.yml ]; then - docker-compose --file docker-compose.test.yml build - docker-compose --file docker-compose.test.yml run sut - else - docker build . --file Dockerfile - fi - # Push image to GitHub Packages. # See also https://docs.docker.com/docker-hub/builds/ push: - # Ensure test job passes before pushing image. - needs: test - runs-on: ubuntu-latest if: github.event_name == 'push' steps: - uses: actions/checkout@v2 - - name: Build image - run: docker build . --file Dockerfile --tag $IMAGE_NAME - - name: Log into GitHub Container Registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://docker.pkg.github.com -u ${{ github.actor }} --password-stdin + - name: Build image + run: docker build . --file Dockerfile --tag $IMAGE_NAME + - name: Push image to GitHub Container Registry run: | - IMAGE_ID=docker.pkg.github.com/${{ github.repository_owner }}/$IMAGE_NAME + IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME # Change all uppercase to lowercase IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')