Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
d45957fbc3
|
|||
|
62a0930a2c
|
|||
|
fb9b41a8be
|
|||
|
d675ac2e39
|
|||
|
97f0ec38be
|
|||
|
ebadb523de
|
|||
|
7e214fc9a1
|
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@@ -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:
|
||||
@@ -38,6 +41,10 @@ jobs:
|
||||
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 +56,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
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user