mirror of
https://github.com/static-web-server/static-web-server.git
synced 2026-01-25 13:17:10 +00:00
It updates all GitHub CI workflow dependencies to their corresponding latest stable versions and improves them when necessary.
185 lines
5.3 KiB
YAML
185 lines
5.3 KiB
YAML
name: release-docker
|
|
on:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
jobs:
|
|
docker-image-alpine:
|
|
runs-on: ubuntu-22.04
|
|
if: contains(github.ref, 'v2.')
|
|
steps:
|
|
-
|
|
name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
-
|
|
name: Docker meta alpine
|
|
id: meta_alpine
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
joseluisq/static-web-server
|
|
ghcr.io/static-web-server/static-web-server
|
|
flavor: |
|
|
latest=false
|
|
suffix=-alpine
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
-
|
|
name: Login to DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Login to ghcr.io
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Prepare Docker envs
|
|
shell: bash
|
|
run: |
|
|
echo "SERVER_VERSION=${GITHUB_REF##*/v}" >> $GITHUB_ENV
|
|
-
|
|
name: Build and push (alpine)
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
push: true
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
|
|
file: ./docker/alpine/Dockerfile
|
|
tags: ${{ steps.meta_alpine.outputs.tags }}
|
|
build-args: |
|
|
SERVER_VERSION=${{ env.SERVER_VERSION }}
|
|
|
|
docker-image-debian:
|
|
needs: ['docker-image-alpine']
|
|
runs-on: ubuntu-22.04
|
|
if: contains(github.ref, 'v2.')
|
|
steps:
|
|
-
|
|
name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
-
|
|
name: Docker meta debian
|
|
id: meta_debian
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
joseluisq/static-web-server
|
|
ghcr.io/static-web-server/static-web-server
|
|
flavor: |
|
|
latest=false
|
|
suffix=-debian
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
-
|
|
name: Login to DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Login to ghcr.io
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Prepare Docker envs
|
|
shell: bash
|
|
run: |
|
|
echo "SERVER_VERSION=${GITHUB_REF##*/v}" >> $GITHUB_ENV
|
|
-
|
|
name: Build and push (debian)
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
push: true
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x
|
|
file: ./docker/debian/Dockerfile
|
|
tags: ${{ steps.meta_debian.outputs.tags }}
|
|
build-args: |
|
|
SERVER_VERSION=${{ env.SERVER_VERSION }}
|
|
|
|
docker-image-scratch:
|
|
needs: ['docker-image-alpine']
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
-
|
|
name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
-
|
|
name: Docker meta scratch
|
|
id: meta_scratch
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
joseluisq/static-web-server
|
|
ghcr.io/static-web-server/static-web-server
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
-
|
|
name: Login to DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Login to ghcr.io
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Prepare Docker envs
|
|
shell: bash
|
|
run: |
|
|
echo "SERVER_VERSION=${GITHUB_REF##*/v}" >> $GITHUB_ENV
|
|
-
|
|
name: Build and push (scratch)
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
push: true
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
|
|
file: ./docker/scratch/Dockerfile
|
|
tags: ${{ steps.meta_scratch.outputs.tags }}
|
|
build-args: |
|
|
SERVER_VERSION=${{ env.SERVER_VERSION }}
|