Skip to content

GitHub Actions Continuous Delivery #28

GitHub Actions Continuous Delivery

GitHub Actions Continuous Delivery #28

Workflow file for this run

name: GitHub Actions Continuous Delivery
on:
push:
branches:
- main
tags:
- '*'
schedule:
# Automatically run on every Day
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
buildx:
runs-on: 1H1G
steps:
-
name: Checkout
uses: actions/checkout@v4.1.7
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.WORKFLOW_SECRET }}
-
name: Set env variables
run: |
echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "http_proxy=${http_proxy}" >> $GITHUB_ENV
echo "no_proxy=${no_proxy}" >> $GITHUB_ENV
-
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v3.2.0
-
# https://github.com/docker/setup-buildx-action/issues/57#issuecomment-1059657292
# https://github.com/docker/buildx/issues/136#issuecomment-550205439
# docker buildx create --driver-opt env.http_proxy=$http_proxy --driver-opt env.https_proxy=$https_proxy --driver-opt '"env.no_proxy='$no_proxy'"'
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.6.1
with:
buildkitd-config: .github/buildkitd.toml
driver-opts: |
env.http_proxy=${{ env.http_proxy }}
env.https_proxy=${{ env.http_proxy }}
env.no_proxy=${{ env.no_proxy }}
-
name: Login to DockerHub
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6.7.0
with:
context: .
build-args: |
http_proxy=${{ env.http_proxy }}
https_proxy=${{ env.http_proxy }}
env.no_proxy=${{ env.no_proxy }}
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/riscv64,linux/s390x
push: true
tags: |
snowdreamtech/wordpress:latest
snowdreamtech/wordpress:6.6.1
snowdreamtech/wordpress:6.6
snowdreamtech/wordpress:6
ghcr.io/snowdreamtech/wordpress:latest
ghcr.io/snowdreamtech/wordpress:6.6.1
ghcr.io/snowdreamtech/wordpress:6.6
ghcr.io/snowdreamtech/wordpress:6