Skip to content

Commit

Permalink
merge GitHub actions and build a single multi-platform Docker contain…
Browse files Browse the repository at this point in the history
…er image.
  • Loading branch information
barnstee committed Oct 2, 2024
1 parent b944f38 commit 35b9cf9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
---
name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
on: # yamllint disable-line rule:truthy
schedule:
- cron: '23 9 * * *'
- cron: "23 9 * * *"
push:
branches: [ main ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
tags: ["v*.*.*"]
pull_request:
branches: [ main ]
merge_group:

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4.2.0

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
uses: docker/login-action@v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -48,16 +48,22 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v5.5.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@v6.7.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 0 additions & 2 deletions UAEdgeTranslator.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UAEdgeTranslator", "UAEdgeT
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{28C9D48D-859A-4F4C-AD74-BF380A944330}"
ProjectSection(SolutionItems) = preProject
.github\workflows\docker-publish-arm64.yml = .github\workflows\docker-publish-arm64.yml
.github\workflows\docker-publish.yml = .github\workflows\docker-publish.yml
Samples\pac4200.jsonld = Samples\pac4200.jsonld
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WoTThingModelGenerator", "WoTThingModelGenerator\WoTThingModelGenerator.csproj", "{37DCF037-4101-45F1-8AF1-5A5D1195C636}"
Expand Down

0 comments on commit 35b9cf9

Please sign in to comment.