Skip to content

Commit

Permalink
Build and publish app image as well
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbarnes committed Nov 20, 2020
1 parent d527823 commit bf84b6d
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
name: Build & Publish Docker Image
runs-on: ubuntu-latest
env:
IMAGE_NAME: docker.pkg.github.com/${{ github.repository }}/decidim-generator
GENERATOR_IMAGE_NAME: docker.pkg.github.com/${{ github.repository }}/decidim-generator
APP_IMAGE_NAME: docker.pkg.github.com/${{ github.repository }}/decidim
TAG: ${{ github.sha }}

steps:
Expand All @@ -38,22 +39,34 @@ jobs:
- name: Checkout Our Repo
uses: actions/checkout@v2

- name: Build Image
- name: Build decidim-generator Image
env:
RUBY_VERSION: ${{ steps.ruby-version.outputs.version }}
DECIDIM_VERSION: ${{ steps.decidim-version.outputs.version }}
run: |
docker build \
--build-arg ruby_version=$RUBY_VERSION \
--build-arg decidim_version=$DECIDIM_VERSION \
-t $IMAGE_NAME:$TAG .
docker tag $IMAGE_NAME:$TAG $IMAGE_NAME:latest
docker tag $IMAGE_NAME:$TAG $IMAGE_NAME:$DECIDIM_VERSION
-t $GENERATOR_IMAGE_NAME:$TAG .
docker tag $GENERATOR_IMAGE_NAME:$TAG $GENERATOR_IMAGE_NAME:latest
docker tag $GENERATOR_IMAGE_NAME:$TAG $GENERATOR_IMAGE_NAME:$DECIDIM_VERSION
- name: Build decidim (app) Image
env:
RUBY_VERSION: ${{ steps.ruby-version.outputs.version }}
DECIDIM_VERSION: ${{ steps.decidim-version.outputs.version }}
run: |
docker build --file Dockerfile-deploy \
-t $APP_IMAGE_NAME:$TAG .
docker tag $APP_IMAGE_NAME:$TAG $APP_IMAGE_NAME:latest
docker tag $APP_IMAGE_NAME:$TAG $APP_IMAGE_NAME:$DECIDIM_VERSION
- name: Publish Image to Github Registry
uses: azure/docker-login@v1
with:
login-server: docker.pkg.github.com
username: $GITHUB_ACTOR
password: ${{ secrets.GITHUB_TOKEN }}
- run: docker push $IMAGE_NAME
- run: |
docker push $GENERATOR_IMAGE_NAME
docker push $APP_IMAGE_NAME

0 comments on commit bf84b6d

Please sign in to comment.