-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github docker 不支持多架构
- Loading branch information
Showing
4 changed files
with
83 additions
and
100 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,40 @@ | ||
name: Github Docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
- edge | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
docker-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build and push Docker images to test docker | ||
if: github.event_name == 'pull_request' | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
registry: docker.pkg.github.com | ||
repository: newfuture/ddns/preview-ddns | ||
tag_with_ref: true | ||
add_git_labels: true | ||
- name: Build and push Docker images to release docker | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
registry: docker.pkg.github.com | ||
repository: newfuture/ddns/ddns | ||
tag_with_ref: true | ||
add_git_labels: true | ||
|
||
|
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,43 @@ | ||
name: dockerhub release | ||
|
||
# build master with multi-arch to docker hub | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
buildx-dockerhub: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_REPO: newfuture/ddns | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKER_PLATFORMS: linux/amd64,linux/arm,linux/arm64 | ||
DOCKER_REGISTRY: "" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Docker buildx | ||
id: buildx | ||
uses: crazy-max/ghaction-docker-buildx@v3 | ||
- name: Prepare arguments | ||
id: prepare | ||
run: | | ||
DOCKER_TAGS="--tag ${DOCKER_REPO}:latest" | ||
if [[ $GITHUB_REF == refs/tags/v* ]]; then | ||
DOCKER_TAGS="${DOCKER_TAGS} --tag ${DOCKER_REPO}:${GITHUB_REF#refs/tags/}" | ||
fi | ||
echo ::set-output name=buildx_args:: --output "type=image,push=true" --platform ${DOCKER_PLATFORMS} ${DOCKER_TAGS} . | ||
- name: Docker login | ||
run: | | ||
echo "${DOCKER_PASSWORD}" | docker login "${DOCKER_REGISTRY}" \ | ||
--username "${DOCKER_USERNAME}" \ | ||
--password-stdin | ||
- name: Run buildx and push | ||
if: success() | ||
run: docker buildx build ${{ steps.prepare.outputs.buildx_args }} | ||
- name: Docker Hub logout | ||
if: always() | ||
run: docker logout |
This file was deleted.
Oops, something went wrong.