Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build and push tagged image upon a new release #61

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ on:
push:
branches:
- main
release:
types: [ published ]

jobs:
buildx:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -50,3 +53,47 @@ jobs:
tags: |
opentransitsoftwarefoundation/${{ matrix.name }}:latest
opentransitsoftwarefoundation/${{ matrix.name }}:${{ github.sha }}

buildx-release:
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
strategy:
matrix:
context: [ bundler, oba ]
include:
- name: onebusaway-bundle-builder
context: bundler
- name: onebusaway-api-webapp
context: oba
steps:
- name: Compute image tag name
run: echo "IMAGE_TAG=$(echo $GITHUB_REF_NAME)" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push images
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
opentransitsoftwarefoundation/${{ matrix.name }}:${{ env.IMAGE_TAG }}
Loading