-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from PSNAppz/1.0
Updated workflows
- Loading branch information
Showing
5 changed files
with
136 additions
and
7 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: SR BG Tasks Beat Producers Tag Workflow | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
branches-ignore: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-to-pypi: | ||
name: Publish to PyPI For Beat Producers Tag | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- uses: actions/checkout@v3 | ||
- name: Install build dependencies | ||
run: pip install build | ||
- name: Build distribution | ||
run: python -m build ./openg2p-sr-celery-beat-producers | ||
- name: Publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages-dir: ./openg2p-sr-celery-beat-producers/dist/ | ||
|
||
docker-build-for-tag: | ||
name: Docker Build and Push For Beat Producers Tag | ||
needs: publish-to-pypi | ||
runs-on: ubuntu-latest | ||
env: | ||
NAMESPACE: ${{ secrets.docker_hub_organisation || 'openg2p' }} | ||
SERVICE_NAME: openg2p-sr-celery-beat-producers | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Docker build | ||
run: | | ||
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
IMAGE_ID=$NAMESPACE/$SERVICE_NAME | ||
# Change all uppercase to lowercase | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
VERSION=$TAG_NAME | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo VERSION=$VERSION | ||
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_ENV | ||
echo VERSION=$VERSION >> $GITHUB_ENV | ||
docker build ./openg2p-sr-celery-beat-producers -f ./openg2p-sr-celery-beat-producers/Dockerfile-pypi \ | ||
--tag $IMAGE_ID:$VERSION | ||
if [[ '${{ secrets.docker_hub_token }}' != '' && '${{ secrets.docker_hub_actor }}' != '' ]]; then | ||
export DOCKER_PUSH="true" | ||
echo DOCKER_PUSH=$DOCKER_PUSH >> $GITHUB_ENV | ||
fi | ||
- name: Docker push | ||
if: env.DOCKER_PUSH == 'true' | ||
run: | | ||
echo "${{ secrets.docker_hub_token }}" | docker login -u ${{ secrets.docker_hub_actor }} --password-stdin | ||
docker push ${{ env.IMAGE_ID }}:${{ env.VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: SR BG Tasks Celery Worker Tag Workflow | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
branches-ignore: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-to-pypi: | ||
name: Publish to PyPI For Workers Tag | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- uses: actions/checkout@v3 | ||
- name: Install build dependencies | ||
run: pip install build | ||
- name: Build distribution | ||
run: python -m build ./openg2p-sr-celery-workers | ||
- name: Publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages-dir: ./openg2p-sr-celery-workers/dist/ | ||
|
||
|
||
docker-build-for-tag: | ||
name: Docker Build and Push For Workers Tag | ||
needs: publish-to-pypi | ||
runs-on: ubuntu-latest | ||
env: | ||
NAMESPACE: ${{ secrets.docker_hub_organisation || 'openg2p' }} | ||
SERVICE_NAME: openg2p-sr-celery-workers | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Docker build | ||
run: | | ||
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
IMAGE_ID=$NAMESPACE/$SERVICE_NAME | ||
# Change all uppercase to lowercase | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
VERSION=$TAG_NAME | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo VERSION=$VERSION | ||
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_ENV | ||
echo VERSION=$VERSION >> $GITHUB_ENV | ||
docker build ./openg2p-sr-celery-workers -f ./openg2p-sr-celery-workers/Dockerfile-pypi \ | ||
--tag $IMAGE_ID:$VERSION | ||
if [[ '${{ secrets.docker_hub_token }}' != '' && '${{ secrets.docker_hub_actor }}' != '' ]]; then | ||
export DOCKER_PUSH="true" | ||
echo DOCKER_PUSH=$DOCKER_PUSH >> $GITHUB_ENV | ||
fi | ||
- name: Docker push | ||
if: env.DOCKER_PUSH == 'true' | ||
run: | | ||
echo "${{ secrets.docker_hub_token }}" | docker login -u ${{ secrets.docker_hub_actor }} --password-stdin | ||
docker push ${{ env.IMAGE_ID }}:${{ env.VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters