Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix deploy on fortrabbit with version number #5139

Merged
merged 1 commit into from
May 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
name: Build assets
outputs:
version: ${{ steps.version.outputs.version }}
release: ${{ steps.version.outputs.release }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -103,15 +104,18 @@ jobs:
exit -1
fi

- name: Get version or revision
- name: Get version
id: version
run: echo "::set-output name=version::$(git describe --abbrev=0 --tags --exact-match $GITHUB_SHA 2>/dev/null || git log --pretty="%h" -n1 $GITHUB_SHA)"
run: |
echo "::set-output name=version::$(git describe --abbrev=0 --tags)"
echo "::set-output name=release::$(git describe --abbrev=0 --tags --exact-match $GITHUB_SHA 2>/dev/null || git log --pretty="%h" -n1 $GITHUB_SHA)"


- name: Prepare environment
run: |
{ \
echo "MIX_PROD_SOURCE_MAPS=true"; \
echo "MIX_SENTRY_RELEASE=${{ steps.version.outputs.version }}"; \
echo "MIX_SENTRY_RELEASE=${{ steps.version.outputs.release }}"; \
} | tee .env

- name: Build assets
Expand All @@ -125,6 +129,7 @@ jobs:
public/mix-manifest.json
public/js
public/css
public/fonts
!public/**/*.map

- name: Store source maps
Expand Down Expand Up @@ -172,7 +177,8 @@ jobs:

- name: Create release files
run: |
echo ${{ needs.build.outputs.version }} > config/.release
echo ${{ needs.build.outputs.version }} > config/.version
echo ${{ needs.build.outputs.release }} > config/.release
echo $GITHUB_SHA > config/.commit

- name: Update .htaccess
Expand Down Expand Up @@ -231,5 +237,5 @@ jobs:
with:
environment: ${{ secrets.SENTRY_ENVIRONMENT }}
sourcemaps: public/js/app.js public/js/app.js.map
version: ${{ needs.build.outputs.version }}
version: ${{ needs.build.outputs.release }}
url_prefix: ~/js