Skip to content

Commit

Permalink
added publish to Github container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
salem84 committed Dec 5, 2020
1 parent cfedc92 commit 8c248f7
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,45 @@ jobs:
docker push "$DOCKER_IMAGE_ID:latest"
fi
publish-ghcr:
runs-on: ubuntu-latest
needs: [deps, lint, test, test-cov, configure]
env:
VERSION: ${{ needs.configure.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build
run: docker build -t $DOCKER_IMAGE_ID .
- name: Check
run: |
docker run $DOCKER_IMAGE_ID version
docker run $DOCKER_IMAGE_ID --help
docker run $DOCKER_IMAGE_ID help
docker run $DOCKER_IMAGE_ID run --help
docker run $DOCKER_IMAGE_ID inspect --help
docker run $DOCKER_IMAGE_ID status --help
docker run $DOCKER_IMAGE_ID stats --help
docker run $DOCKER_IMAGE_ID scale --help
docker run $DOCKER_IMAGE_ID pause --help
docker run $DOCKER_IMAGE_ID resume --help
- name: Publish
if: github.event_name != 'pull_request'
run: |
echo "REF=${{ github.ref }}"
echo "DOCKER_IMAGE_ID=$DOCKER_IMAGE_ID"
# Log into registry
echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
VERSION="${VERSION#v}"
echo "VERSION=$VERSION"
docker tag "$DOCKER_IMAGE_ID" "ghcr.io/${{ github.repository_owner }}/$DOCKER_IMAGE_ID:$VERSION"
docker push "ghcr.io/${{ github.repository_owner }}/$DOCKER_IMAGE_ID:$VERSION"
# We also want to tag the latest stable version as latest
if [[ "$VERSION" != "master" ]] && [[ ! "$VERSION" =~ (RC|rc) ]]; then
docker tag "$DOCKER_IMAGE_ID" "ghcr.io/${{ github.repository_owner }}/$DOCKER_IMAGE_ID:latest"
docker push "ghcr.io/${{ github.repository_owner }}/$DOCKER_IMAGE_ID:latest"
fi
publish-github:
runs-on: ubuntu-latest
needs: [deps, lint, test, test-cov, configure, build]
Expand Down

0 comments on commit 8c248f7

Please sign in to comment.