Skip to content

Commit 00c7f0d

Browse files
Fix build (#33)
* change dockerfile * change release * fix skip build * fix env values
1 parent dfad522 commit 00c7f0d

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
token: ${{ secrets.GITHUB_TOKEN }}
7070
makeLatest: ${{ inputs.latest }}
7171
tag: ${{ env.NEW_VERSION }}
72+
7273
define_envs:
7374
runs-on: ubuntu-latest
7475
steps:
@@ -90,24 +91,28 @@ jobs:
9091
id: get_current_date_time
9192
run: |
9293
echo "CURRENT_DATE_TIME=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
94+
outputs:
95+
repo_name: ${{ steps.get_repo_name.outputs.stdout }}
96+
repo_full_name: ${{ steps.get_repo_full_name.outputs.stdout }}
97+
current_date_time: ${{ steps.get_current_date_time.outputs.stdout }}
9398

9499
build-service:
95100
runs-on: ubuntu-latest
96-
needs: release
101+
needs: [release, define_envs]
97102
steps:
103+
- name: Get output variables from define_envs job
104+
id: get_env_vars
105+
run: echo "::set-output name=repo_name::${{ needs.define_envs.outputs.repo_name }}::set-output name=repo_full_name::${{ needs.define_envs.outputs.repo_full_name }}::set-output name=current_date_time::${{ needs.define_envs.outputs.current_date_time }}"
106+
98107
- name: Define service tags
99-
shell: bash
100-
id: define_tags
101108
run: |
102109
if [ "${{ inputs.latest }}" = "true" ]; then
103-
echo "SERVICE_TAGS=ghcr.io/${{ env.REPO_FULL_NAME }}/service:${{ env.NEW_VERSION }},ghcr.io/${{ env.REPO_FULL_NAME }}/service:latest" >> $GITHUB_ENV
110+
echo "SERVICE_TAGS=ghcr.io/${{ needs.define_envs.outputs.repo_full_name }}/service:${{ env.NEW_VERSION }},ghcr.io/${{ needs.define_envs.outputs.repo_full_name }}/service:latest" >> $GITHUB_ENV
104111
else
105-
echo "SERVICE_TAGS=ghcr.io/${{ env.REPO_FULL_NAME }}/service:${{ env.NEW_VERSION }}" >> $GITHUB_ENV
112+
echo "SERVICE_TAGS=ghcr.io/${{ needs.define_envs.outputs.repo_full_name }}/service:${{ env.NEW_VERSION }}" >> $GITHUB_ENV
106113
fi
107114
env:
108115
NEW_VERSION: ${{ env.NEW_VERSION }}
109-
REPO_NAME: ${{ env.REPO_NAME }}
110-
REPO_FULL_NAME: ${{ env.REPO_FULL_NAME }}
111116

112117
- name: Log in to the Container registry
113118
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
@@ -130,21 +135,21 @@ jobs:
130135

131136
build-app:
132137
runs-on: ubuntu-latest
133-
needs: release
138+
needs: [release, define_envs]
134139
steps:
140+
- name: Get output variables from define_envs job
141+
id: get_env_vars
142+
run: echo "::set-output name=repo_name::${{ needs.define_envs.outputs.repo_name }}::set-output name=repo_full_name::${{ needs.define_envs.outputs.repo_full_name }}::set-output name=current_date_time::${{ needs.define_envs.outputs.current_date_time }}"
143+
135144
- name: Define app tags
136-
shell: bash
137-
id: define_tags
138145
run: |
139146
if [ "${{ inputs.latest }}" = "true" ]; then
140-
echo "APP_TAGS=ghcr.io/${{ env.REPO_FULL_NAME }}/app:${{ env.NEW_VERSION }},ghcr.io/${{ env.REPO_FULL_NAME }}/app:latest" >> $GITHUB_ENV
147+
echo "APP_TAGS=ghcr.io/${{ needs.define_envs.outputs.repo_full_name }}/app:${{ env.NEW_VERSION }},ghcr.io/${{ needs.define_envs.outputs.repo_full_name }}/app:latest" >> $GITHUB_ENV
141148
else
142-
echo "APP_TAGS=ghcr.io/${{ env.REPO_FULL_NAME }}/app:${{ env.NEW_VERSION }}" >> $GITHUB_ENV
149+
echo "APP_TAGS=ghcr.io/${{ needs.define_envs.outputs.repo_full_name }}/app:${{ env.NEW_VERSION }}" >> $GITHUB_ENV
143150
fi
144151
env:
145152
NEW_VERSION: ${{ env.NEW_VERSION }}
146-
REPO_NAME: ${{ env.REPO_NAME }}
147-
REPO_FULL_NAME: ${{ env.REPO_FULL_NAME }}
148153

149154
- name: Log in to the Container registry
150155
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9

0 commit comments

Comments
 (0)