release-published #109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and push Docker image | ||
on: | ||
workflow_dispatch: | ||
repository_dispatch: | ||
types: [release-published] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [18.x] | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
egress-policy: audit | ||
- name: checkout | ||
uses: actions/checkout@v4.1.1 | ||
with: | ||
path: backstage | ||
ref: v${{ github.event.client_payload.version }} | ||
- name: use node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4.0.0 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: https://registry.npmjs.org/ # Needed for auth | ||
- name: yarn install | ||
uses: backstage/actions/yarn-install@v0.6.5 | ||
with: | ||
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} | ||
- name: create-app | ||
run: npx @backstage/create-app | ||
env: | ||
BACKSTAGE_APP_NAME: example-app | ||
- name: yarn build | ||
run: yarn build:backend | ||
working-directory: ./example-app | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3.0.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3.0.0 | ||
- name: Build and push | ||
uses: docker/build-push-action@v5.1.0 | ||
with: | ||
context: './example-app' | ||
file: ./example-app/packages/backend/Dockerfile | ||
push: ${{ github.event_name == "repository_dispatch" && github.event.action == "release-published" }} | ||
Check failure on line 64 in .github/workflows/deploy_docker-image.yml
|
||
platforms: linux/amd64,linux/arm64 | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/backstage:latest | ||
ghcr.io/${{ github.repository_owner }}/backstage:${{ github.event.client_payload.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. |