Docker Image Public Release #77
Workflow file for this run
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 workflow publishes a new docker image to 'https://hub.docker.com/r/stellar/stellar-disbursement-platform-frontend' | ||
# when a new release is created or when we merge something to the develop branch. | ||
name: Docker Image Public Release | ||
on: | ||
release: | ||
types: | ||
- published | ||
push: | ||
branches: | ||
- develop | ||
jobs: | ||
test-build: | ||
uses: ./.github/workflows/test-build.yml # execute the callable test-build.yml | ||
secrets: inherit # pass all secrets | ||
build_and_push_docker_image_on_release: | ||
if: github.event_name == 'release' | ||
name: Push to DockerHub (release prd) # stellar/stellar-disbursement-platform-frontend:{VERSION} | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test-build | ||
steps: | ||
- name: Check if tag is not empty | ||
run: | | ||
if [[ -z "${{ github.event.release.tag_name }}" ]]; then | ||
echo "Release tag name cannot be empty." | ||
exit 1 | ||
fi | ||
- uses: actions/checkout@v3 | ||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push to DockerHub (release prd) | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
build-args: | | ||
GIT_COMMIT=${{ github.event.release.tag_name }} | ||
tags: | | ||
Check failure on line 46 in .github/workflows/docker_image_public_release.yml GitHub Actions / Docker Image Public ReleaseInvalid workflow file
Check failure on line 46 in .github/workflows/docker_image_public_release.yml GitHub Actions / Docker Image Public ReleaseInvalid workflow file
|
||
stellar/stellar-disbursement-platform-frontend:${{github.event.release.tag_name}} | ||
${{ if eq(github.event.release.prerelease, 'false') }}stellar/stellar-disbursement-platform-frontend:latest${{ endif }} | ||
file: Dockerfile | ||
build_and_push_docker_image_on_dev_push: | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/develop' | ||
name: Push to DockerHub (release develop branch) # stellar/stellar-disbursement-platform-frontend:edge-{DATE}-{SHA} | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test-build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Get current date | ||
id: get_date | ||
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
- name: Get SHA | ||
shell: bash | ||
id: get_sha | ||
run: | ||
echo "SHA=$(git rev-parse --short ${{ github.sha }} )" >> | ||
$GITHUB_OUTPUT | ||
- name: Build and push to DockerHub (develop branch) | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
build-args: | | ||
GIT_COMMIT=${{ steps.get_sha.outputs.SHA }} | ||
tags: | ||
stellar/stellar-disbursement-platform-frontend:edge,stellar/stellar-disbursement-platform-frontend:edge-${{steps.get_date.outputs.DATE | ||
}}-${{ steps.get_sha.outputs.SHA }} | ||
file: Dockerfile | ||
complete: | ||
if: always() | ||
needs: | ||
- build_and_push_docker_image_on_release | ||
- build_and_push_docker_image_on_dev_push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- if: | ||
contains(needs.*.result, 'failure') || contains(needs.*.result, | ||
'cancelled') | ||
run: exit 1 | ||
# TODO: figure out which job failed and print the logs |