Skip to content

1.24.2

1.24.2 #374

name: Publish Docker Images
on:
release:
types: [published]
workflow_call:
secrets:
GOOGLE_SERVICE_ACCOUNT_ENCODED:
required: true
GOOGLE_PROJECT_NAME:
required: true
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
jobs:
Publish-Default-Docker-Image:
runs-on: ubuntu-latest
container:
image: google/cloud-sdk
options: --user root
env:
GOOGLE_SERVICE_ACCOUNT_ENCODED: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ENCODED }}
GOOGLE_APPLICATION_CREDENTIALS: /gcloud-service-key.json
DOCKER_CLI_EXPERIMENTAL: enabled
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create Diffgram Version Production From Tag or Branch
if: "!github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ github.ref_name }}" >> $GITHUB_ENV
- uses: xt0rted/pull-request-comment-branch@v1
if: "github.event.issue.pull_request"
id: comment-branch
- name: Create Diffgram Version From PR Comment
if: "github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ steps.comment-branch.outputs.head_ref }}" >> $GITHUB_ENV
- name: Test
run: |
echo ${{ env.diffgram_version }}
- name: Check if tag exists
id: tagCheck
continue-on-error: true
run: |
docker manifest inspect diffgram/default:${{ env.diffgram_version }} > /dev/null ; echo $?
- name: Check out repository code
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
uses: actions/checkout@v2
with:
ref: ${{ env.diffgram_version }}
- name: Get Version From Branch Name
if: github.ref_type != 'branch'
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Echo
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: echo ${{ steps.tag.outputs.result }}
- name: Publish
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: |
docker build . -t diffgram/default -f default/Dockerfile
docker tag diffgram/default diffgram/default:${{ env.diffgram_version }}
docker push diffgram/default
docker build . -t diffgram/default -f default/Dockerfile.newrelic
docker tag diffgram/default diffgram/default:newrelic-${{ env.diffgram_version }}
docker push diffgram/default --all-tags
Publish-Eventhandlers-Docker-Image:
runs-on: ubuntu-latest
container:
image: google/cloud-sdk
options: --user root
env:
GOOGLE_SERVICE_ACCOUNT_ENCODED: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ENCODED }}
GOOGLE_APPLICATION_CREDENTIALS: /gcloud-service-key.json
DOCKER_CLI_EXPERIMENTAL: enabled
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create Diffgram Version Production From Tag or Branch
if: "!github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ github.ref_name }}" >> $GITHUB_ENV
- uses: xt0rted/pull-request-comment-branch@v1
if: "github.event.issue.pull_request"
id: comment-branch
- name: Create Diffgram Version From PR Comment
if: "github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ steps.comment-branch.outputs.head_ref }}" >> $GITHUB_ENV
- name: Test
run: |
echo ${{ env.diffgram_version }}
- name: Check if tag exists
id: tagCheck
continue-on-error: true
run: |
docker manifest inspect diffgram/eventhandlers:${{ env.diffgram_version }} > /dev/null ; echo $?
- name: Check out repository code
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
uses: actions/checkout@v2
with:
ref: ${{ env.diffgram_version }}
- name: Get Version From Branch Name
if: github.ref_type != 'branch'
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Echo
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: echo ${{ steps.tag.outputs.result }}
- name: Publish
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: |
docker build . -t diffgram/eventhandlers -f eventhandlers/Dockerfile
docker tag diffgram/eventhandlers diffgram/eventhandlers:${{ env.diffgram_version }}
docker push diffgram/eventhandlers
docker build . -t diffgram/eventhandlers -f eventhandlers/Dockerfile.newrelic
docker tag diffgram/eventhandlers diffgram/eventhandlers:newrelic-${{ env.diffgram_version }}
docker push diffgram/eventhandlers --all-tags
Publish-Walrus-Docker-Image:
runs-on: ubuntu-latest
container:
image: google/cloud-sdk
options: --user root
env:
GOOGLE_SERVICE_ACCOUNT_ENCODED: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ENCODED }}
GOOGLE_APPLICATION_CREDENTIALS: /gcloud-service-key.json
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create Diffgram Version Production From Tag or Branch
if: "!github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ github.ref_name }}" >> $GITHUB_ENV
- uses: xt0rted/pull-request-comment-branch@v1
if: "github.event.issue.pull_request"
id: comment-branch
- name: Create Diffgram Version From PR Comment
if: "github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ steps.comment-branch.outputs.head_ref }}" >> $GITHUB_ENV
- name: Check if tag exists
id: tagCheck
continue-on-error: true
run: |
docker manifest inspect diffgram/walrus:${{ env.diffgram_version }} > /dev/null ; echo $?
- name: Check out repository code
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
uses: actions/checkout@v2
with:
ref: ${{ env.diffgram_version }}
- name: Test
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: |
echo $RELEASE_VERSION
echo ${{ env.diffgram_version }}
- name: Echo
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: echo ${{ steps.tag.outputs.result }}
- name: Publish
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: |
docker build . -t diffgram/walrus -f walrus/Dockerfile
docker tag diffgram/walrus diffgram/walrus:${{ env.diffgram_version }}
docker push diffgram/walrus
docker push diffgram/walrus:${{ env.diffgram_version }}
docker build . -t diffgram/walrus -f walrus/Dockerfile.newrelic
docker tag diffgram/walrus diffgram/walrus:newrelic-${{ env.diffgram_version }}
docker push diffgram/walrus --all-tags
Publish-Frontend-Docker-Image:
runs-on: ubuntu-latest
container:
image: google/cloud-sdk
options: --user root
env:
GOOGLE_SERVICE_ACCOUNT_ENCODED: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ENCODED }}
GOOGLE_APPLICATION_CREDENTIALS: /gcloud-service-key.json
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create Diffgram Version Production From Tag or Branch
if: "!github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ github.ref_name }}" >> $GITHUB_ENV
- uses: xt0rted/pull-request-comment-branch@v1
if: "github.event.issue.pull_request"
id: comment-branch
- name: Create Diffgram Version From PR Comment
if: "github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ steps.comment-branch.outputs.head_ref }}" >> $GITHUB_ENV
- name: Check if tag exists
id: tagCheck
continue-on-error: true
run: |
docker manifest inspect diffgram/frontend:${{ env.diffgram_version }} > /dev/null ; echo $?
- name: Check out repository code
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
uses: actions/checkout@v2
with:
ref: ${{ env.diffgram_version }}
- name: Echo
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: echo ${{ steps.tag.outputs.result }}
- name: Publish
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: |
docker build . -t diffgram/frontend -f frontend/Dockerfile
docker tag diffgram/frontend diffgram/frontend:${{ env.diffgram_version }}
docker push diffgram/frontend
docker build . -t diffgram/frontend -f frontend/Dockerfile
docker tag diffgram/frontend diffgram/frontend:newrelic-${{ env.diffgram_version }}
docker push diffgram/frontend --all-tags
Publish-Dispatcher-Docker-Image:
runs-on: ubuntu-latest
container:
image: google/cloud-sdk
options: --user root
env:
GOOGLE_SERVICE_ACCOUNT_ENCODED: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ENCODED }}
GOOGLE_APPLICATION_CREDENTIALS: /gcloud-service-key.json
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create Diffgram Version Production From Tag or Branch
if: "!github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ github.ref_name }}" >> $GITHUB_ENV
- uses: xt0rted/pull-request-comment-branch@v1
if: "github.event.issue.pull_request"
id: comment-branch
- name: Create Diffgram Version From PR Comment
if: "github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ steps.comment-branch.outputs.head_ref }}" >> $GITHUB_ENV
- name: Check if tag exists
id: tagCheck
continue-on-error: true
run: |
docker manifest inspect diffgram/local_dispatcher:${{ env.diffgram_version }} > /dev/null ; echo $?
- name: Check out repository code
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
uses: actions/checkout@v2
with:
ref: ${{ env.diffgram_version }}
- name: Echo
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: echo ${{ steps.tag.outputs.result }}
- name: Publish
if: "steps.tagCheck.outcome == 'failure' || github.ref_type == 'branch'"
run: |
docker build . -t diffgram/local_dispatcher -f local_dispatcher/Dockerfile
docker tag diffgram/local_dispatcher diffgram/local_dispatcher:${{ env.diffgram_version }}
docker push diffgram/local_dispatcher
docker build . -t diffgram/local_dispatcher -f local_dispatcher/Dockerfile
docker tag diffgram/local_dispatcher diffgram/local_dispatcher:newrelic-${{ env.diffgram_version }}
docker push diffgram/local_dispatcher --all-tags