Skip to content

Commit

Permalink
fix: dockerize ignores git tags (#9027)
Browse files Browse the repository at this point in the history
* chore(ci): package name removed from the PR title

* chore(ci): Release please now will not include the component name on the tags. Tag release will be added to the Release Please PRs

* fix: remove health check (#9001)

Signed-off-by: Matt Krick <[email protected]>

* fix: re-add serverHealthChecker (#9024)

Signed-off-by: Matt Krick <[email protected]>

* fix: ignore git tags when building

Signed-off-by: Matt Krick <[email protected]>

* fix: bash typo

Signed-off-by: Matt Krick <[email protected]>

---------

Signed-off-by: Matt Krick <[email protected]>
Co-authored-by: Rafael Romero <[email protected]>
  • Loading branch information
mattkrick and rafaelromcar-parabol authored Oct 23, 2023
1 parent a6520c1 commit e9ae97e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,25 @@ jobs:
- name: Setup environment variables
run: |
echo "NODE_VERSION=$(jq -r -j '.engines.node|ltrimstr("^")' package.json)" >> $GITHUB_ENV
IS_RELEASE=${{ startsWith(github.event.head_commit.message, 'chore(release): release') }}
IS_MANUAL_BUILD=${{ startsWith(github.event.head_commit.message, 'dockerize') }}
echo IS_RELEASE=$IS_RELEASE
echo IS_MANUAL_BUILD=$IS_MANUAL_BUILD
if [ ${{github.ref_type}} = "tag" ]; then
if [ $IS_RELEASE = true ]; then
echo IS_RELEASE_TRUE
DOCKER_REPOSITORY_FOR_REF=${{ secrets.GCP_AR_PARABOL }}
else
DOCKER_REPOSITORY_FOR_REF=${{ secrets.GCP_AR_PARABOL_DEV }}
fi
echo DOCKER_REPOSITORY_FOR_REF=$DOCKER_REPOSITORY_FOR_REF
echo "DOCKER_REPOSITORY_FOR_REF=${DOCKER_REPOSITORY_FOR_REF}" >> $GITHUB_ENV
GITHUB_REF_NAME_NORMALIZED=$(echo ${{github.ref_name}} | tr / -)
echo "GITHUB_REF_NAME_NORMALIZED=${GITHUB_REF_NAME_NORMALIZED}" >> $GITHUB_ENV
DOCKERIZE=${{ github.ref_type == 'tag' || contains(fromJSON('["master", "release", "staging", "production"]'), github.ref_name) || startsWith(github.event.head_commit.message, 'dockerize')}}
DOCKERIZE=$IS_RELEASE || $IS_MANUAL_BUILD
echo DOCKERIZE=$DOCKERIZE
echo "DOCKERIZE=${DOCKERIZE}" >> $GITHUB_ENV
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_ENV
ACTION_VERSION=$(grep '"version":' package.json | cut -d\" -f4)
echo "ACTION_VERSION=${ACTION_VERSION}" >> $GITHUB_ENV
Expand Down Expand Up @@ -188,9 +193,9 @@ jobs:
push: true
tags: |
"${{ secrets.GCP_AR_PARABOL_DEV }}:${{github.sha}}"
"${{ env.DOCKER_REPOSITORY_FOR_REF }}:${{ env.GITHUB_REF_NAME_NORMALIZED }}"
"${{ env.DOCKER_REPOSITORY_FOR_REF }}:v${{ env.ACTION_VERSION }}"
- name: Push Artifacts to Sentry
if: github.ref_type == 'tag'
if: env.IS_RELEASE == 'true'
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: "${{secrets.SENTRY_AUTH_TOKEN}}"
Expand All @@ -201,7 +206,7 @@ jobs:
sourcemaps: "./build"
version: ${{env.ACTION_VERSION}}
- name: Push Artifacts to Datadog
if: github.ref_type == 'tag'
if: env.IS_RELEASE == 'true'
env:
DATADOG_API_KEY: "${{secrets.DATADOG_API_KEY}}"
CDN_BUILD_URL: "https://action-files.parabol.co/production/build/"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ jobs:
with:
command: manifest
default-branch: release
release-type: node

0 comments on commit e9ae97e

Please sign in to comment.