mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat: use buildx for multi-arch docker image build (#3603)
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
name: '[docker] CI for releases'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: master
|
||||
paths:
|
||||
- 'lib/**'
|
||||
- 'Dockerfile'
|
||||
- 'package.json'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
-
|
||||
name: Dockerhub login
|
||||
env:
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
run: |
|
||||
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
-
|
||||
name: Build dockerfile (with push)
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
run: |
|
||||
docker buildx build \
|
||||
--platform=linux/amd64,linux/arm/v7,linux/arm64 \
|
||||
--output "type=image,push=true" \
|
||||
--file ./Dockerfile . \
|
||||
--tag $(echo "${DOCKER_USERNAME}" | tr '[:upper:]' '[:lower:]')/rsshub:latest
|
||||
@@ -0,0 +1,36 @@
|
||||
name: '[docker] CI for build tests'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: master
|
||||
paths:
|
||||
- 'lib/**'
|
||||
- 'Dockerfile'
|
||||
- 'package.json'
|
||||
push:
|
||||
branches: '*'
|
||||
paths:
|
||||
- 'lib/**'
|
||||
- 'Dockerfile'
|
||||
- 'package.json'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
-
|
||||
name: Build dockerfile (without push)
|
||||
run: |
|
||||
docker buildx build \
|
||||
--platform=linux/amd64,linux/arm/v7,linux/arm64 \
|
||||
--output "type=image,push=false" \
|
||||
--file ./Dockerfile .
|
||||
Reference in New Issue
Block a user