summaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows/build-image-on-push.yml
diff options
context:
space:
mode:
authorLibravatar Seth For Privacy <40500387+sethforprivacy@users.noreply.github.com>2024-04-23 10:06:15 -0400
committerLibravatar GitHub <noreply@github.com>2024-04-23 14:06:15 +0000
commit91926dd2cd0a2008adbeb1b9fec12d84b8496204 (patch)
tree440d274b37fdd92aacf59ca5c7cd25591bb04731 /.github/workflows/build-image-on-push.yml
parent3c494018142b5a1c236681eb9a2abc9010ea1014 (diff)
downloadsentrum-91926dd2cd0a2008adbeb1b9fec12d84b8496204.tar.gz
sentrum-91926dd2cd0a2008adbeb1b9fec12d84b8496204.tar.bz2
sentrum-91926dd2cd0a2008adbeb1b9fec12d84b8496204.zip
Add Dockerfile and GAs for Docker image deployment
* Initial Dockerfile and Github Actions * Properly name final Docker build stage * Add tag for package.version * Correct cargo-get syntax * Fix version tagging and add sentrum.toml to .gitignore * Fix newlines and add Docker examples * Fix branch on Github Action and minor copy update
Diffstat (limited to '.github/workflows/build-image-on-push.yml')
-rw-r--r--.github/workflows/build-image-on-push.yml56
1 files changed, 56 insertions, 0 deletions
diff --git a/.github/workflows/build-image-on-push.yml b/.github/workflows/build-image-on-push.yml
new file mode 100644
index 0000000..2f02fb5
--- /dev/null
+++ b/.github/workflows/build-image-on-push.yml
@@ -0,0 +1,56 @@
+name: "Test build of image when Dockerfile is changed"
+
+on:
+ push:
+ paths:
+ - 'Dockerfile'
+ branches-ignore:
+ - master
+ pull_request:
+ paths:
+ - 'Dockerfile'
+ workflow_dispatch:
+
+jobs:
+ rebuild-container:
+ name: "Build image with cache"
+ runs-on: ubuntu-latest
+ steps:
+ -
+ name: Set up QEMU
+ uses: docker/setup-qemu-action@v3.0.0
+ with:
+ platforms: linux/arm64
+ -
+ name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3.3.0
+ -
+ name: Checkout repository
+ uses: actions/checkout@v4
+ -
+ name: Build x86_64 image
+ id: docker_build_amd64
+ uses: docker/build-push-action@v5.3.0
+ with:
+ push: false
+ load: true
+ platforms: linux/amd64
+ tags: sentrum:amd64
+ cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/sentrum:latest
+ -
+ name: Test-run x86_64 image
+ run: |
+ docker run --rm sentrum:amd64 &
+ PID=$!
+ sleep 5
+ kill -SIGINT $PID # this will return a non-zero exit code if the container dies early on
+ -
+ name: Build ARMv8 image
+ id: docker_build_arm64
+ uses: docker/build-push-action@v5.3.0
+ with:
+ push: false
+ load: true
+ platforms: linux/arm64
+ tags: sentrum:arm64
+ cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/sentrum:latest