Skip to content

Commit

Permalink
fix: package app on release
Browse files Browse the repository at this point in the history
  • Loading branch information
kalil-pelissier committed Dec 24, 2022
1 parent 4690717 commit 5c3e8da
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 34 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Package

on:
push:
branches:
- main
tags:
- v*

jobs:
package:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
flavor: ${{ inputs.docker-metadata-flavor }}
- id: extract-env
run: |
if [[ "$GITHUB_REF_TYPE" == tag ]]
then
echo "environment=production" >> $GITHUB_OUTPUT
else
echo "environment=qa" >> $GITHUB_OUTPUT
fi
- uses: docker/build-push-action@v3
with:
build-args: |
BUILD_MODE=${{ steps.extract-env.outputs.environment }}
context: .
file: Dockerfile.app
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
36 changes: 2 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Release

on:
push:
branches: [ main ]
branches:
- main

jobs:
drafter:
Expand All @@ -13,36 +14,3 @@ jobs:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package:
needs: drafter
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
flavor: ${{ inputs.docker-metadata-flavor }}
- id: extract-env
run: |
if [[ "$GITHUB_REF_TYPE" == tag ]]
then
echo "environment=production" >> $GITHUB_OUTPUT
else
echo "environment=qa" >> $GITHUB_OUTPUT
fi
- uses: docker/build-push-action@v3
with:
build-args: |
BUILD_MODE=${{ steps.extract-env.outputs.environment }}
context: .
file: Dockerfile.app
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 5c3e8da

Please sign in to comment.