8 Commits
0.1.1 ... 0.1.4

Author SHA1 Message Date
daa019f0c3 feat: Updates to build arm images in ci
Some checks failed
Create and publish a Docker image / build-and-push-image (push) Failing after 6s
2024-11-05 12:35:29 -05:00
d45957fbc3 feat: Updates to build arm images in ci
Some checks failed
Create and publish a Docker image / build-and-push-image (push) Failing after 6s
2024-11-05 12:26:43 -05:00
62a0930a2c feat: Updates image tags
Some checks failed
Create and publish a Docker image / build-and-push-image (push) Failing after 7s
2024-11-05 12:16:17 -05:00
fb9b41a8be feat: Using slim image to cut down on size of docker container application 2024-11-05 12:11:31 -05:00
d675ac2e39 fix: Updates tag name when building images 2024-11-05 11:42:26 -05:00
97f0ec38be fix: Updates tag name when building images 2024-11-05 11:39:15 -05:00
ebadb523de fix: Updates tag name when building images 2024-11-05 11:35:34 -05:00
7e214fc9a1 fix: Updates tag name when building images 2024-11-05 11:27:48 -05:00
3 changed files with 17 additions and 4 deletions

View File

@@ -5,11 +5,14 @@ name: Create and publish a Docker image
on:
push:
branches: ['release']
tags:
- '*'
workflow_dispatch:
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: swift-mqtt-dewpoint
IMAGE_NAME: ${{ github.repository }}
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
@@ -32,12 +35,20 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker-setup-buildx-action@v2
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
@@ -49,6 +60,7 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
- name: Generate artifact attestation

View File

@@ -8,6 +8,7 @@ COPY . .
RUN swift build --enable-test-discovery -c release -Xswiftc -g
# Run image
FROM swift:5.10
FROM swift:5.10-slim
WORKDIR /run
COPY --from=build /build/.build/release /run
COPY --from=build /build/.build/release/dewPoint-controller /run
CMD ["/bin/bash", "-xc", "./dewPoint-controller"]

View File

@@ -2,8 +2,8 @@
services:
server:
image: swift-mqtt-dewpoint:latest
restart: unless-stopped
env_file: .env
command: /bin/bash -xc "./dewPoint-controller"
test:
image: swift:latest