Skip to content

Commit

Permalink
Turn on ghcrio post (#11)
Browse files Browse the repository at this point in the history
* Turn on ghcrio post

* test 1

* added GITHUB PUSH to env

* updated changelog

* Change github package repository name

* revert back

---------

Co-authored-by: Chen Wang <[email protected]>
  • Loading branch information
ywkim312 and longshuicy authored Jan 19, 2024
1 parent dc7872c commit d30bc59
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/graphql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,28 @@ jobs:
tags="$BRANCH"
fi
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV
# should we push to dockerhub, and is there a README
DOCKERHUB_PUSH="false"
DOCKERHUB_README="false"
if [ "${{ github.repository }}" == "${{ env.MAIN_REPO }}" ]; then
if [ "${{ secrets.DOCKERHUB_USERNAME }}" != "" -a "${{ secrets.DOCKERHUB_PASSWORD }}" != "" ]; then
DOCKERHUB_PUSH="true"
if [ -e "README.md" ]; then
DOCKERHUB_README="true"
if [ ${BRANCH} == "main" ]; then
if [ "${{ secrets.DOCKERHUB_USERNAME }}" != "" -a "${{ secrets.DOCKERHUB_PASSWORD }}" != "" ]; then
DOCKERHUB_PUSH="true"
if [ -e "README.md" ]; then
DOCKERHUB_README="true"
fi
fi
fi
fi
# should we push to Github
GITHUB_PUSH="false"
if [ "${{ github.repository }}" == "${{ env.MAIN_REPO }}" ]; then
GITHUB_PUSH="true"
fi
# should we push to NCSA
NCSAHUB_PUSH="false"
if [ "${{ github.repository }}" == "${{ env.MAIN_REPO }}" ]; then
Expand All @@ -97,7 +107,9 @@ jobs:
if [ "$NCSAHUB_PUSH" == "true" ]; then
IMAGES="${IMAGES}${NCSAHUB}/${IMAGE}:${tag},"
fi
# IMAGES="${IMAGES}ghcr.io/${OWNER_LC}/${IMAGE}:${tag},"
if [ "$GITHUB_PUSH" == "true" ]; then
IMAGES="${IMAGES}ghcr.io/${OWNER_LC}/${IMAGE}:${tag},"
fi
done
IMAGES="${IMAGES%,*}"
Expand All @@ -107,12 +119,14 @@ jobs:
echo "DOCKERHUB_README=${DOCKERHUB_README}"
echo "DOCKERHUB_PUSH=${DOCKERHUB_PUSH}"
echo "NCSAHUB_PUSH=${NCSAHUB_PUSH}"
echo "GITHUB_PUSH=${GITHUB_PUSH}"
echo "IMAGES=${IMAGES}"
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "DOCKERHUB_README=${DOCKERHUB_README}" >> $GITHUB_ENV
echo "DOCKERHUB_PUSH=${DOCKERHUB_PUSH}" >> $GITHUB_ENV
echo "GITHUB_PUSH=${GITHUB_PUSH}" >> $GITHUB_ENV
echo "NCSAHUB_PUSH=${NCSAHUB_PUSH}" >> $GITHUB_ENV
echo "IMAGES=${IMAGES}" >> $GITHUB_ENV
Expand Down Expand Up @@ -157,6 +171,7 @@ jobs:

# build the docker images
- name: Build and push docker
if: env.DOCKERHUB_PUSH == 'true' || env.NCSAHUB_PUSH == 'true' || env.GITHUB_PUSH == 'true'
uses: docker/build-push-action@v3
with:
context: ./
Expand All @@ -179,4 +194,4 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ env.DOCKERHUB_ORG }}/${{ github.event.repository.name }}
readme-filepath: README.md
readme-filepath: README.md
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Github action for auto generating docker container [#4](https://github.com/ncsa/standalone-smm-smile-graphql/issues/4)

### Changed
- Github action goes to Docker Hub when it only releases a tag [#8](https://github.com/ncsa/standalone-smm-smile-graphql/issues/8)

## [0.2.8] - 2023-08-04
### Added
- Support for Twitter V2 API [#2](https://github.com/ncsa/standalone-smm-smile-graphql/issues/2)

0 comments on commit d30bc59

Please sign in to comment.