-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
60 additions
and
32 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,36 +1,64 @@ | ||
name: '[docker] CI for stable releases' | ||
|
||
on: | ||
name: 'Docker Stable Releases' | ||
'on': | ||
push: | ||
branches: stable | ||
branches: | ||
- stable | ||
paths: | ||
- .github/workflows/docker-release-stable.yml | ||
- lib/** | ||
- '!**/maintainer.js' | ||
- '!**/radar.js' | ||
- '!lib/**/*.test.ts' | ||
- Dockerfile | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata (stable) | ||
id: meta-stable | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ secrets.DOCKER_USERNAME }}/rsshub | ||
ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=raw,value=stable,enable=true | ||
type=raw,value=stable-{{date 'YYYY-MM-DD'}},enable=true | ||
type=sha,format=long,prefix=,enable=true | ||
flavor: latest=false | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
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:stable \ | ||
--tag $(echo "${DOCKER_USERNAME}" | tr '[:upper:]' '[:lower:]')/rsshub:stable-$(date +%Y)-$(date +%m)-$(date +%d) | ||
- name: Build and push Docker image (stable) | ||
id: build-and-push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta-stable.outputs.tags }} | ||
labels: ${{ steps.meta-stable.outputs.labels }} | ||
platforms: linux/amd64,linux/arm/v7,linux/arm64 | ||
cache-from: type=gha,scope=docker-release | ||
cache-to: type=gha,mode=max,scope=docker-release |