-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea2211f
commit 0874320
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Build and push the stable image | ||
|
||
# triggered by publishing a release | ||
on: | ||
release: | ||
types: [published] | ||
|
||
## GITHUB_TOKEN authentication | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
buildandpush: | ||
runs-on: ubuntu-latest | ||
# we only want to run this on stable releases | ||
if: github.event.release.prerelease == false | ||
steps: | ||
# https://github.com/CycodeLabs/cimon-action | ||
- name: Cimon supply chain attack protection | ||
uses: cycodelabs/cimon-action@v0 | ||
with: | ||
client-id: ${{ secrets.CIMON_CLIENT_ID }} | ||
secret: ${{ secrets.CIMON_SECRET }} | ||
prevent: true | ||
allowed-hosts: > | ||
codeload.github.com | ||
dl-cdn.alpinelinux.org | ||
docker.io | ||
ghcr.io | ||
index.docker.io | ||
nginx.org | ||
packagist.org | ||
pkg-containers.githubusercontent.com | ||
production.cloudflare.docker.com | ||
registry.yarnpkg.com | ||
repo.yarnpkg.com | ||
- name: Checkout elabimg repo | ||
uses: actions/checkout@v3 | ||
|
||
# https://github.com/marketplace/actions/docker-setup-buildx | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# https://github.com/docker/setup-qemu-action#usage | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
# https://github.com/docker/login-action#docker-hub | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
# https://github.com/docker/build-push-action#multi-platform-image | ||
# https://docs.docker.com/build/ci/github-actions/cache/ | ||
- name: Build latest release for all platforms and push to Docker Hub | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/arm64,linux/amd64 | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
build-args: | | ||
ELABFTW_VERSION=${{ github.ref_name }} | ||
tags: | | ||
elabftw/elabimg:stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters