aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2022-04-25 11:06:01 +0200
committerBadlop <badlop@process-one.net>2022-05-02 13:25:18 +0200
commitea4a365bf5253806aaf5fe725bac0a30e6bcc3f9 (patch)
treee9d58c37cec7e7f4d137cfaf862971342a4bf6be /.github
parentContainer: When ERLANG_COOKIE is set, create cookie file; otherwise use -setc... (diff)
Container: New GitHub workflow to build and publish containers
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/container.yml69
1 files changed, 69 insertions, 0 deletions
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
new file mode 100644
index 000000000..84adc5558
--- /dev/null
+++ b/.github/workflows/container.yml
@@ -0,0 +1,69 @@
+name: Container
+
+on:
+ push:
+ paths-ignore:
+ - '.devcontainer/**'
+ - 'examples/**'
+ - 'lib/**'
+ - 'man/**'
+ - 'priv/**'
+ - '**.md'
+
+env:
+ REGISTRY: ghcr.io
+ IMAGE_NAME: ${{ github.repository }}
+
+jobs:
+ container:
+ name: Container
+ runs-on: ubuntu-20.04
+ permissions:
+ packages: write
+ steps:
+
+ - name: Check out repository code
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Log in to the Container registry
+ uses: docker/login-action@v1.14.1
+ with:
+ registry: ${{ env.REGISTRY }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Get git describe
+ id: gitdescribe
+ run: echo "::set-output name=ver::$(git describe --tags)"
+
+ - name: Extract metadata (tags, labels) for Docker
+ id: meta
+ uses: docker/metadata-action@v3.8.0
+ with:
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
+ labels: |
+ org.opencontainers.image.revision=${{ steps.gitdescribe.outputs.ver }}
+ org.opencontainers.image.licenses=GPL-2.0
+ org.opencontainers.image.vendor=ProcessOne
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v2.10.0
+ with:
+ build-args: |
+ VERSION=${{ steps.gitdescribe.outputs.ver }}
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
+ context: .github/container
+ labels: ${{ steps.meta.outputs.labels }}
+ #platforms: linux/amd64,linux/arm64 # arm takes 30 mins to compile
+ platforms: linux/amd64
+ push: true
+ tags: ${{ steps.meta.outputs.tags }}