Skip to content

Commit

Permalink
Use seperate workflows for dev and prod images
Browse files Browse the repository at this point in the history
  • Loading branch information
fjudith committed Sep 15, 2023
1 parent 7a8c6d3 commit 091b16e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Build and push Docker image
on:
# release:
# types: [published, prereleased]
push:

tags:
- '*.*.*-rc*'
- '*.*.*-beta*'
- '*.*.*-alpha*'
- '*.*.*-hotfix*'
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -20,9 +22,6 @@ jobs:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Workarount "libsqlite3-dev" installation failing
run: sudo apt-get install -y --no-install-recommends libsqlite3-dev

- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down Expand Up @@ -53,11 +52,10 @@ jobs:
uses: docker/build-push-action@v4
with:
context: './'
file: ./Dockerfile
file: ./packages/backend/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/backstage:latest
ghcr.io/${{ github.repository_owner }}/backstage:${{ steps.get_version.outputs.VERSION }}
labels: |
org.opencontainers.image.description=Docker image generated from the latest Backstage release; this contains what you would get out of the box by running npx @backstage/create-app and building a Docker image from the generated source. This is meant to ease the process of evaluating Backstage for the first time, but also has the severe limitation that there is no way to install additional plugins relevant to your infrastructure.
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/build_container_prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and push Docker image
on:
# release:
# types: [published, prereleased]
push:
branches:
- main
tags:
- '*.*.*'

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- name: checkout
uses: actions/checkout@v3

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v4
with:
context: './'
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/backstage:latest
ghcr.io/${{ github.repository_owner }}/backstage:${{ steps.get_version.outputs.VERSION }}
labels: |
org.opencontainers.image.description=Docker image generated from the latest Backstage release; this contains what you would get out of the box by running npx @backstage/create-app and building a Docker image from the generated source. This is meant to ease the process of evaluating Backstage for the first time, but also has the severe limitation that there is no way to install additional plugins relevant to your infrastructure.
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.version=${{ steps.get_version.outputs.VERSION }}

0 comments on commit 091b16e

Please sign in to comment.