Merge pull request #39 from snowdreamtech/gh-actions-update-1729731770 #75
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: 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/[email protected] | |
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/[email protected] | |
- | |
# 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/[email protected] | |
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/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/[email protected] | |
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/nginx:latest | |
snowdreamtech/nginx:1.26.2 | |
snowdreamtech/nginx:1.26 | |
snowdreamtech/nginx:1 | |
ghcr.io/snowdreamtech/nginx:latest | |
ghcr.io/snowdreamtech/nginx:1.26.2 | |
ghcr.io/snowdreamtech/nginx:1.26 | |
ghcr.io/snowdreamtech/nginx:1 | |