Skip to content

Commit

Permalink
chore(ci): conditional dockerhub build env (#1103)
Browse files Browse the repository at this point in the history
Use MIX_ENV=prod on version tags and MIX_ENV=dev for master
  • Loading branch information
venimus committed Dec 29, 2022
1 parent c8f498d commit 184b112
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/dockerhub.yml
Expand Up @@ -7,16 +7,26 @@ on:
tags:
- v*

env:
MIX_ENV: dev

jobs:
dockerhub:
name: "Publish to Dockehub"
runs-on: ubuntu-latest
# Don't run on forks
if: github.repository == 'aeternity/ae_mdw'

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 100

- name: Sets MIX_ENV to prod for release
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo "MIX_ENV=prod" >> $GITHUB_ENV
- name: Extract metadata for docker
id: meta
uses: docker/metadata-action@v4
Expand All @@ -26,7 +36,7 @@ jobs:
type=raw,value=master,enable={{is_default_branch}}
type=sha,prefix=,enable={{is_default_branch}}
type=semver,pattern={{version}},enable={{is_default_branch}}
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
Expand All @@ -38,7 +48,7 @@ jobs:
if: ${{ steps.meta.outputs.tags }}
with:
context: .
build-args: MIX_ENV=prod
build-args: MIX_ENV=${{env.MIX_ENV}}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 184b112

Please sign in to comment.