Skip to content

Commit b8a5d1a

Browse files
authored
Merge pull request #139 from n0th1ng-else/version-4
2 parents d3e3a9b + 22e8d6e commit b8a5d1a

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
version:
99
runs-on: ubuntu-latest
1010
name: Push new version
11+
outputs:
12+
version: ${{ steps.getversion.outputs.version }}
1113
steps:
1214
- name: Checkout
1315
uses: actions/checkout@v2
@@ -30,18 +32,17 @@ jobs:
3032
env:
3133
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3234

35+
- name: Read VERSION file
36+
id: getversion
37+
run: echo "::set-output name=version::$(cat .VERSION)"
38+
3339
docker:
3440
runs-on: ubuntu-latest
3541
name: Push docker image
3642
needs: version
3743
steps:
38-
- name: Read app version into ENV
39-
run: |
40-
VER=$(cat .VERSION)
41-
echo "APP_VERSION=$VER" >> $GITHUB_ENV
42-
4344
- name: App version
44-
run: echo Picked the app version ${{ env.APP_VERSION }}-${{ github.sha }}
45+
run: echo Picked the app version ${{ needs.version.outputs.version }}-${{ github.sha }}
4546

4647
- name: Checkout
4748
uses: actions/[email protected]
@@ -58,20 +59,15 @@ jobs:
5859
password: ${{ secrets.GITHUB_TOKEN }}
5960
repository: '${{ github.actor }}/n0th1ng-else.github.io/n0th1ng-else-blog'
6061
tag_with_sha: true
61-
build_args: APP_VERSION=${{ github.sha }},COMMIT_HASH=${{ env.APP_VERSION }},GH_AUTHOR_LOGIN=${{ secrets.GH_AUTHOR_LOGIN }},GH_AUTHOR_LINKED_IN=${{ secrets.GH_AUTHOR_LINKED_IN }},GH_AUTHOR_TELEGRAM=${{ secrets.GH_AUTHOR_TELEGRAM }},GH_AUTHOR_MEDIUM=${{ secrets.GH_AUTHOR_MEDIUM }},GH_AUTHOR_HABR=${{ secrets.GH_AUTHOR_HABR }},GH_AUTHOR_NPM=${{ secrets.GH_AUTHOR_NPM }},GH_AUTHOR_TWITTER=${{ secrets.GH_AUTHOR_TWITTER }},GH_AUTHOR_DEVTO=${{ secrets.GH_AUTHOR_DEVTO }}
62+
build_args: APP_VERSION=${{ needs.version.outputs.version }},COMMIT_HASH=${{ env.APP_VERSION }},GH_AUTHOR_LOGIN=${{ secrets.GH_AUTHOR_LOGIN }},GH_AUTHOR_LINKED_IN=${{ secrets.GH_AUTHOR_LINKED_IN }},GH_AUTHOR_TELEGRAM=${{ secrets.GH_AUTHOR_TELEGRAM }},GH_AUTHOR_MEDIUM=${{ secrets.GH_AUTHOR_MEDIUM }},GH_AUTHOR_HABR=${{ secrets.GH_AUTHOR_HABR }},GH_AUTHOR_NPM=${{ secrets.GH_AUTHOR_NPM }},GH_AUTHOR_TWITTER=${{ secrets.GH_AUTHOR_TWITTER }},GH_AUTHOR_DEVTO=${{ secrets.GH_AUTHOR_DEVTO }}
6263

6364
heroku:
6465
runs-on: ubuntu-latest
6566
name: Deploy to Heroku
6667
needs: version
6768
steps:
68-
- name: Read app version into ENV
69-
run: |
70-
VER=$(cat .VERSION)
71-
echo "APP_VERSION=$VER" >> $GITHUB_ENV
72-
7369
- name: App version
74-
run: echo Picked the app version ${{ env.APP_VERSION }}-${{ github.sha }}
70+
run: echo Picked the app version ${{ needs.version.outputs.version }}-${{ github.sha }}
7571

7672
- name: Checkout
7773
uses: actions/[email protected]
@@ -90,7 +86,7 @@ jobs:
9086
- name: Push docker image
9187
run: |
9288
heroku container:${{ env.D_ACTION }} web --app ${{ env.D_NAME }} --arg \
93-
APP_VERSION=${{ env.APP_VERSION }},\
89+
APP_VERSION=${{ needs.version.outputs.version }},\
9490
COMMIT_HASH=${{ env.D_VERSION }},\
9591
GH_AUTHOR_LOGIN=${{ secrets.GH_AUTHOR_LOGIN }},\
9692
GH_AUTHOR_LINKED_IN=${{ secrets.GH_AUTHOR_LINKED_IN }},\

0 commit comments

Comments
 (0)