Docker Image CI #30
Workflow file for this run
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
name: Docker Image CI | |
on: | |
push: | |
# branches: | |
# - "master" | |
tags: | |
- "v*.*.*" | |
pull_request: | |
branches: | |
- "master" | |
jobs: | |
# # NOTE: Not required for now | |
# prepare: | |
# name: Prepare environment | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Free Disk Space (Ubuntu) | |
# uses: insightsengineering/disk-space-reclaimer@v1 | |
# with: | |
# # this might remove tools that are actually needed, | |
# # if set to "true" but frees about 6 GB | |
# tools-cache: true | |
# # all of these default to true, but feel free to set to | |
# # "false" if necessary for your workflow | |
# android: true | |
# dotnet: true | |
# haskell: true | |
# large-packages: true | |
# swap-storage: true | |
# docker-images: true | |
base: | |
name: Base image | |
runs-on: ubuntu-latest | |
# needs: prepare | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: rigon/sharelatex-full | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Print tags | |
run: | | |
echo "== TAGS ==========================" | |
echo "${{ steps.meta.outputs.tags }}" | |
echo "== /TAGS =========================" | |
# - name: Build and push Docker image | |
# uses: docker/build-push-action@v6 | |
# with: | |
# context: . | |
# target: base | |
# push: true | |
# platforms: linux/amd64 #,linux/arm64,linux/arm/v6 | |
# tags: ${{ steps.meta.outputs.tags }} | |
# labels: ${{ steps.meta.outputs.labels }} | |
# cache-from: type=gha | |
# cache-to: type=gha,mode=max | |
shell-escape: | |
name: Shell-escape image | |
runs-on: ubuntu-latest | |
needs: base | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: rigon/sharelatex-full | |
flavor: | | |
latest=auto | |
suffix=-shell-escape | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}},value=shell-escape | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Print tags | |
run: | | |
echo "== TAGS ==========================" | |
echo "${{ steps.meta.outputs.tags }}" | |
echo "== /TAGS =========================" | |
# - name: Build and push Docker image | |
# uses: docker/build-push-action@v6 | |
# with: | |
# context: . | |
# target: shell-escape | |
# push: true | |
# platforms: linux/amd64 #,linux/arm64,linux/arm/v6 | |
# tags: ${{ steps.meta.outputs.tags }} | |
# labels: ${{ steps.meta.outputs.labels }} | |
# cache-from: type=gha | |
# cache-to: type=gha,mode=max |